Add Color unit tests

This commit is contained in:
Shadowfacts 2019-06-22 11:02:21 -04:00
parent 2b739899a1
commit 27518c68df
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 25 additions and 0 deletions

View 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)
}
}