generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dimension.toString() displays "dimensionless" when dimension is …
…None
- Loading branch information
Peva Blanchard
committed
Jul 12, 2023
1 parent
25526aa
commit e19d5f1
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/test/kotlin/ch/kleis/lcaplugin/core/lang/dimension/DimensionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package ch.kleis.lcaplugin.core.lang.dimension | ||
|
||
import kotlin.test.assertEquals | ||
import org.junit.Test | ||
|
||
|
||
class DimensionTest { | ||
|
||
@Test | ||
fun test_toString_whenNone() { | ||
// given | ||
val dimension = Dimension.None | ||
|
||
// when | ||
val actual = "$dimension" | ||
|
||
// then | ||
assertEquals("dimensionless", actual) | ||
} | ||
|
||
@Test | ||
fun test_toString_whenSimpleDim() { | ||
// given | ||
val dimension = Dimension.of("something") | ||
|
||
// when | ||
val actual ="$dimension" | ||
|
||
// then | ||
assertEquals("something", actual) | ||
} | ||
|
||
@Test | ||
fun test_toString_whenSmallPower() { | ||
// given | ||
val dimension = Dimension.of("something", 2) | ||
|
||
// when | ||
val actual ="$dimension" | ||
|
||
// then | ||
assertEquals("something²", actual) | ||
} | ||
} |