Skip to content

Commit

Permalink
test: Remove redundant test variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrylo committed Nov 2, 2023
1 parent b1cce26 commit 6e55b55
Showing 1 changed file with 33 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,34 @@ class VssSpecificationArithmeticTest : BehaviorSpec({
val valueLong = VssValueLong(value = 100L)
val valueDouble = VssValueDouble(value = 100.0)

val values = listOf<Number>(5, 5L, 5f, 5.0)
val value = 5

`when`("a plus operation is done") {
val newValues = values.map {
listOf(
valueInt + it,
valueFloat + it,
valueLong + it,
valueDouble + it,
)
}
val newValues = listOf(
valueInt + value,
valueFloat + value,
valueLong + value,
valueDouble + value,
)

then("it should correctly add the values") {
newValues.forEach { properties ->
properties.forEach {
it.value shouldBe 105
}
newValues.forEach {
it.value shouldBe 105
}
}
}

`when`("a minus operation is done") {
val newValues = values.map {
listOf(
valueInt - it,
valueFloat - it,
valueLong - it,
valueDouble - it,
)
}
val newValues = listOf(
valueInt - value,
valueFloat - value,
valueLong - value,
valueDouble - value,
)

then("it should correctly subtract the values") {
newValues.forEach { properties ->
properties.forEach {
it.value shouldBe 95
}
newValues.forEach {
it.value shouldBe 95
}
}
}
Expand All @@ -88,39 +80,31 @@ class VssSpecificationArithmeticTest : BehaviorSpec({
}

`when`("a divide operation is done") {
val newValues = values.map {
listOf(
valueInt / it,
valueFloat / it,
valueLong / it,
valueDouble / it,
)
}
val newValues = listOf(
valueInt / value,
valueFloat / value,
valueLong / value,
valueDouble / value,
)

then("it should correctly divide the values") {
newValues.forEach { properties ->
properties.forEach {
it.value shouldBe 20
}
newValues.forEach {
it.value shouldBe 20
}
}
}

`when`("a multiply operation is done") {
val newValues = values.map {
listOf(
valueInt * it,
valueFloat * it,
valueLong * it,
valueDouble * it,
)
}
val newValues = listOf(
valueInt * value,
valueFloat * value,
valueLong * value,
valueDouble * value,
)

then("it should correctly multiply the values") {
newValues.forEach { properties ->
properties.forEach {
it.value shouldBe 500
}
newValues.forEach {
it.value shouldBe 500
}
}
}
Expand Down

0 comments on commit 6e55b55

Please sign in to comment.