The Value of 0xFF Number and Its Uses With & Operation in Java Article by Abdallah Sawan
This commit is contained in:
parent
b2a3a69b4a
commit
506953bb56
|
@ -3,7 +3,7 @@ package com.baeldung.number_0xff;
|
|||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class Number0xffUtitTest {
|
||||
public class Number0xffUnitTest {
|
||||
|
||||
@Test
|
||||
public void test0xFFAssignedToInteger() {
|
||||
|
@ -20,28 +20,28 @@ public class Number0xffUtitTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void givenColor_thenExtractRedColor() {
|
||||
public void givenColor_whenGetRedColor_thenExtractRedColor() {
|
||||
int rgba = 272214023;
|
||||
int expectedValue = 64;
|
||||
assertEquals(Number0xff.getRedColor(rgba), expectedValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenColor_thenExtractGreenColor() {
|
||||
public void givenColor_whenGetGreenColor_thenExtractGreenColor() {
|
||||
int rgba = 272214023;
|
||||
int expectedValue = 57;
|
||||
assertEquals(Number0xff.getGreenColor(rgba), expectedValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenColor_thenExtractBlueColor() {
|
||||
public void givenColor_whenGetBlueColor_thenExtractBlueColor() {
|
||||
int rgba = 272214023;
|
||||
int expectedValue = 168;
|
||||
assertEquals(Number0xff.getBlueColor(rgba), expectedValue);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenColor_thenExtractAlfa() {
|
||||
public void givenColor_whenGetAlfa_thenExtractAlfa() {
|
||||
int rgba = 272214023;
|
||||
int expectedValue = 7;
|
||||
assertEquals(Number0xff.getAlfa(rgba), expectedValue);
|
||||
|
|
Loading…
Reference in New Issue