@Test public void multipleActions() { Zone zone = new Zone(); zone.addLastUserAction(new UserAction(null, null, null, null, UpdateAction.UPDATE_ZONE)); zone.addLastUserAction(new UserAction(null, null, null, null, UpdateAction.SAVE_ZOMBIES)); zone.addLastUserAction(new UserAction(null, null, null, null, UpdateAction.SAVE_PEEK)); assertEquals(3, zone.getLastUserActions().size()); }
@Test public void toJson() { Zone zone = new Zone(); zone.addLastUserAction(new UserAction(null, null, null, null, UpdateAction.UPDATE_ZONE)); String json = GsonUtil.objectToJson(zone); assertTrue(json.contains(UpdateAction.UPDATE_ZONE.toString())); }
@Test public void sameActionTwice() { Zone zone = new Zone(); zone.addLastUserAction(new UserAction(null, null, null, null, UpdateAction.UPDATE_ZONE)); zone.addLastUserAction(new UserAction(null, null, null, null, UpdateAction.UPDATE_ZONE)); assertEquals(1, zone.getLastUserActions().size()); }