コード例 #1
0
 @Test
 public void exits_that_havent_been_added_are_not_exitable() {
   final Exit exit = mockery.mock(Exit.class);
   mockery.checking(
       new Expectations() {
         {
           ignoring(exit);
         }
       });
   Location l = createLocation();
   assertFalse(l.exitable(exit));
 }
コード例 #2
0
 @Test
 public void non_visible_exits_are_not_exitable() {
   final Exit exit = mockery.mock(Exit.class);
   mockery.checking(
       new Expectations() {
         {
           allowing(exit).visible();
           will(returnValue(false));
           ignoring(exit);
         }
       });
   Location l = createLocation();
   l.addExit(exit);
   assertFalse(l.exitable(exit));
 }
コード例 #3
0
 @Test
 public void added_exit_makes_the_exit_exitable() {
   final Exit exit = mockery.mock(Exit.class);
   mockery.checking(
       new Expectations() {
         {
           allowing(exit).visible();
           will(returnValue(true));
           ignoring(exit);
         }
       });
   Location l = createLocation();
   l.addExit(exit);
   assertTrue(l.exitable(exit));
 }