ãJUnitå®è·µå ¥éãæ£èª¤è¡¨(6) #junitbook
誤æ¤éå ±ãã®6ã§ãã
ãã®1ãããã®5ã¾ã§ã¯åå·ã®ã¿ã®èª¤æ¤ã§2å·ã§ã¯ä¿®æ£æ¸ã¿ã§ãã
その1(2刷反映済),その2(2刷反映済),その3(2刷反映済), その4(2刷反映済), その5(2刷反映済), 技評さんの公式サイトã§ãï¼ãã£ã¦åæ ããã¾ãï¼ã
P362 ãã¹ãã±ã¼ã¹ã®ãªã¹ãï¼çªç®ï¼æå¾ï¼
誤ï¼
Itemã1ã¤è¿½å ããã¦ããç¶æ ã§ãaddã§åãItemãªãã¸ã§ã¯ãã追å ããã¨getNumã§1ãåå¾ã§ãã
æ£ï¼
Itemã1ã¤è¿½å ããã¦ããç¶æ
ã§ãaddã§ç°ãªãItemãªãã¸ã§ã¯ãã追å ããã¨getNumã§1ãåå¾ã§ãã
ãªã¹ã18.10ã®ãã¹ãã³ã¼ãï¼æå¾ã®ãã¹ãã±ã¼ã¹ï¼ã«å¯¾å¿ãããã¹ãã±ã¼ã¹ã§ãããã¹ãã³ã¼ãã«èª¤æ¤ã¯ããã¾ããã
P19.9 è¤æ°è¡ããã¹ãã®ã¢ãµã¼ã·ã§ã³
ãã¹ãã³ã¼ãä¸ã®æå¾
å¤ã«èª¤ããããã¾ãã
誤ï¼
public class MultiLineStringTest { @Test public void joinã§æååãé£çµããã() throws Exception { String ls = System.getProperty("line.separator"); String expected = "Hello" + ls + "World"; assertThat(MultiLineString.join("Hello", "World"), is(text(expected))); } }
æ£ï¼
public class MultiLineStringTest {
@Test
public void joinã§æååãé£çµããã() throws Exception {
String ls = System.getProperty("line.separator");
String expected = "Hello" + ls + "World" + ls;
assertThat(MultiLineString.join("Hello", "World"), is(text(expected)));
}
}
å ¬éæ¸ã¿ã®ãµã³ãã«ã³ã¼ãã¯æ£ããã³ã¼ãã¨ãªã£ã¦ãããæ¸ç±ã®ã¿èª¤æ¤ã«ãªãã¾ãã
ãè¿·æãããããã¦ç³ã訳ããã¾ããã
(7)ã«ç¶ã...