00116 20150401 Class Assert - AngryQA/blog GitHub Wiki

Class Assert

AngryQA | 2015-04-01 ์ˆ˜์š”์ผ ์˜คํ›„ 10:31 | ํ…Œ์ŠคํŠธ ๋„๊ตฌ/JUint ๋“ฑ / ๋‹จ์œ„ํ…Œ์ŠคํŠธ | ์›๋ณธ

JUnit์„ ์‚ฌ์šฉํ•˜์—ฌ ๋‹จ์œ„ ํ…Œ์ŠคํŠธ๋ฅผ ๋งŒ๋“ค๋˜ ์ค‘

๋‹จ์ •๋ฌธ์— ๋Œ€ํ•œ ์ •๋ฆฌ๊ฐ€ ํ•„์š”ํ•˜์—ฌ ์ž‘์„ฑํ•˜๋Š” ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค~ :D

์ž์„ธํ•œ ๋‹จ์ •๋ฌธ์˜ ๋Œ€ํ•œ ์„ค๋ช…์€ ์•„๋ž˜ ๋งํฌ ์ฐธ์กฐ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค!

http://junit.sourceforge.net/javadoc/org/junit/Assert.html 

โ€ป๋Œ€ํ‘œ์ ์ธ ๋‹จ์ •๋ฌธ

assertArrayEquals(a,b) : ๋ฐฐ์—ด a์™€b๊ฐ€ ์ผ์น˜ํ•จ์„ ํ™•์ธ

[assertArrayEquals](http://junit.sourceforge.net/javadoc/org/junit/Assert.html#assertArrayEquals(byte[], byte[]))(byte[] expecteds, byte[] actuals)            Asserts that two byte arrays are equal.

assertEquals(a,b) : ๊ฐ์ฒด a์™€b์˜ ๊ฐ’์ด ๊ฐ™์€์ง€ ํ™•์ธ

[assertEquals](http://junit.sourceforge.net/javadoc/org/junit/Assert.html#assertEquals(double, double))(double expected, double actual)            Deprecated. Use assertEquals(double expected, double actual, double epsilon) instead

assertSame(a,b) : ๊ฐ์ฒด a์™€b๊ฐ€ ๊ฐ™์€ ๊ฐ์ฒด์ž„์„ ํ™•์ธ

[assertSame](http://junit.sourceforge.net/javadoc/org/junit/Assert.html#assertSame(java.lang.Object, java.lang.Object))(java.lang.Object expected, java.lang.Object actual)            Asserts that two objects refer to the same object.

assertTrue(a) : a๊ฐ€ ์ฐธ์ธ์ง€ ํ™•์ธ

assertTrue(boolean condition)            Asserts that a condition is true.

assertNotNull(a) : a๊ฐ์ฒด๊ฐ€ null์ด ์•„๋‹˜์„ ํ™•์ธ

assertNotNull(java.lang.Object object)            Asserts that an object isn't null.