コード例 #1
0
 @Test(expected = UnsupportedQuestionException.class)
 public void ExampleService_does_not_know_the_Answer_to_the_Penultimate() throws Exception {
   service.getTheAnswerTo("What's for dinner");
 }
コード例 #2
0
 @Test
 public void
     ExampleService_knows_the_Answer_to_the_Ultimate_Question_of_Life_the_Universe_and_Everything_is_42()
         throws Exception {
   assertEquals(THE_ULTIMATE_ANSWER, service.getTheAnswerTo(THE_ULTIMATE_QUESTION));
 }