0
public void testNullsInName() {
fail("sample failure");
Person p = new Person(null, "lastName");
assertEquals("lastName", p.getFullName());
p = new Person("Tanner", null);
assertEquals("Tanner ?", p.getFullName());
}
나는 Junit에서 이해하기 어려움이 있습니다. 아무도 나에게 위의 방법에서 실패의 사용을 말해 주시겠습니까 ?? (그 책임은 무엇인지 알고 싶습니다.)Junit 테스트 메소드에 대한 쿼리
그리고 일반적으로 위의 코드에도이 내용을 추가하고 싶습니다. 어떻게 추가 할 수 있습니까
Person p = new Person(null, "lastName"); // After this statement
if(p==null)
{
// then dont proceed further to the further execution
// Show the Junit Test case as PASS .
}
도와주세요.
대단히 고마워요, 당신은 내 하루를 축하해주었습니다. – Pawan