Skip to content

Commit

Permalink
Fixed test-smells
Browse files Browse the repository at this point in the history
  • Loading branch information
Rogiel committed Mar 22, 2021
1 parent 2d50dec commit 62574ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Expand Up @@ -52,9 +52,9 @@ public void tearUp() {
public void testAllocate() {
final int id1 = allocator.allocate();
final int id2 = allocator.allocate();
assertFalse(id1 == id2);
assertEquals(IDAllocator.FIRST_ID, id1);
assertEquals(IDAllocator.FIRST_ID + 1, id2);
assertFalse("IDs must not be equal", id1 == id2);
assertEquals("First allocated ID must be equal to the first allocatable ID", IDAllocator.FIRST_ID, id1);
assertEquals("IDs must increment sequentially", IDAllocator.FIRST_ID + 1, id2);
}

/**
Expand Down
Expand Up @@ -70,8 +70,8 @@ public void tearUp() throws ServiceStartException {
public void testCreateID() {
final ID<Integer> id1 = charIdFactory.createID();
final ID<Integer> id2 = charIdFactory.createID();
Assert.assertNotNull(id1);
Assert.assertFalse(id1.equals(id2));
Assert.assertNotNull("Must return a valid ID.", id1);
Assert.assertFalse("Must allocate unique IDs.", id1.equals(id2));
}

/**
Expand All @@ -82,6 +82,7 @@ public void testDestroy() {
final CharacterID id1 = charIdFactory.createID();
Assert.assertNotNull(id1);
charIdFactory.destroy(id1);
Assert.assertNull(charIdFactory.resolveID(id1.getID()));
}

/**
Expand Down
Expand Up @@ -78,8 +78,7 @@ public void testAdd() {
*/
@Test(expected = NullPointerException.class)
public void testAddNullId() {
final L2Character character = new L2Character(null);
world.add(character);
world.add(null);
}

/**
Expand Down

0 comments on commit 62574ee

Please sign in to comment.