package com.pixelized.desktop.lwa.business

import com.pixelized.shared.lwa.usecase.CharacterSheetUseCase
import org.junit.Test

class DamageBonusUseCaseTest {

    @Test
    fun testBonusDamage() {
        val userCase = CharacterSheetUseCase()

        (0 until 12).forEach {
            val result = userCase.meleeBonusDamage(sum = it)
            val expected = "-1d6"
            assert(result == expected) {
                "Expected:'$expected' bonus damage for stat:'$it' but was:'$result'"
            }
        }
        (12 until 18).forEach {
            val result = userCase.meleeBonusDamage(sum = it)
            val expected = "-1d4"
            assert(result == expected) {
                "Expected:'$expected' bonus damage for stat:'$it' but was:'$result'"
            }
        }
        (18 until 23).forEach {
            val result = userCase.meleeBonusDamage(sum = it)
            val expected = "+0"
            assert(result == expected) {
                "Expected:'$expected' bonus damage for stat:'$it' but was:'$result'"
            }
        }
        (23 until 30).forEach {
            val result = userCase.meleeBonusDamage(sum = it)
            val expected = "+1d4"
            assert(result == expected) {
                "Expected:'$expected' bonus damage for stat:'$it' but was:'$result'"
            }
        }
        (30 until 40).forEach {
            val result = userCase.meleeBonusDamage(sum = it)
            val expected = "+1d6"
            assert(result == expected) {
                "Expected:'$expected' bonus damage for stat:'$it' but was:'$result'"
            }
        }
        (40 until 100).forEach {
            val result = userCase.meleeBonusDamage(sum = it)
            val expected = "+2d6"
            assert(result == expected) {
                "Expected:'$expected' bonus damage for stat:'$it' but was:'$result'"
            }
        }
    }
}
