TDD: 테스트 주도 개발
:객체 a,b가 같은 객체임을 확인한다. 객제 자체를 비교한다.
객체 a,b가 일치함을 확인하다. 객체에 정의된 equasl를 통해 비교.
배열 a,b가 일치함을 확인
a가 참인지 확인
a가 Not null인지 확인
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
@SpringBootTest
class Weather2ApplicationTests {
static int[] arr = {1,2};
@Test
void assertSame() {
assertEquals("a","a");
assertEquals(1,1);
int[] arr2 = {1,2};
assertArrayEquals(arr,arr2);
}
@Test
void assertTrue(){
Assertions.assertTrue(true);
Assertions.assertTrue(1+2==3);
}
@Test
void assertNotNull() {
Assertions.assertNotNull(arr);
}
}