4748495051525354555657
} public void testOpenedLock() { Door door = new Door(); door.state = Door.OPEN; door.lock(); assertSame(Door.OPEN_LOCKED, door.state); } public void testOpenedClose() { Door door = new Door();
8283848586878889909192
public void testLockedLock() { Door door = new Door(); door.state = Door.LOCKED; try { door.lock(); fail("expected exception"); } catch (IllegalStateException e) { } }
119120121122123124125126127128129
public void testOpenLockedLock() { Door door = new Door(); door.state = Door.OPEN_LOCKED; try { door.lock(); fail("expected exception"); } catch (IllegalStateException e) { } }
1213141516171819202122
assertSame(Door.OPEN, door.state); } public void testClosedLock() { Door door = new Door(); door.lock(); assertSame(Door.LOCKED, door.state); } public void testClosedClose() { Door door = new Door();