Add Color unit tests
This commit is contained in:
parent
2b739899a1
commit
27518c68df
25
src/test/kotlin/net/shadowfacts/shadowui/util/ColorTest.kt
Normal file
25
src/test/kotlin/net/shadowfacts/shadowui/util/ColorTest.kt
Normal file
@ -0,0 +1,25 @@
|
||||
package net.shadowfacts.shadowui.util
|
||||
|
||||
import org.junit.jupiter.api.Assertions.*
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
/**
|
||||
* @author shadowfacts
|
||||
*/
|
||||
class ColorTest {
|
||||
|
||||
@Test
|
||||
fun fromRGB() {
|
||||
val color = Color(0x123456)
|
||||
assertEquals(0x12, color.red)
|
||||
assertEquals(0x34, color.green)
|
||||
assertEquals(0x56, color.blue)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun toARGB() {
|
||||
val color = Color(red = 0x12, green = 0x34, blue = 0x56, alpha = 0x78)
|
||||
assertEquals(0x78123456, color.argb)
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user