добавлен тест H2Player equals
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
package mc.core.h2db;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotEquals;
|
||||||
|
|
||||||
|
public class TestH2Player {
|
||||||
|
@Test
|
||||||
|
public void testEquals() {
|
||||||
|
UUID uuid = UUID.randomUUID();
|
||||||
|
|
||||||
|
H2Player player1 = new H2Player();
|
||||||
|
player1.setId(1);
|
||||||
|
player1.setUuid(uuid);
|
||||||
|
player1.setName("Player1");
|
||||||
|
|
||||||
|
H2Player player2 = new H2Player();
|
||||||
|
player2.setId(1);
|
||||||
|
player2.setUuid(uuid);
|
||||||
|
player2.setName("Player2");
|
||||||
|
|
||||||
|
assertEquals(player1, player2);
|
||||||
|
|
||||||
|
player2.setId(2);
|
||||||
|
|
||||||
|
assertNotEquals(player1, player2);
|
||||||
|
|
||||||
|
player2.setId(1);
|
||||||
|
player2.setUuid(UUID.randomUUID());
|
||||||
|
|
||||||
|
assertNotEquals(player1, player2);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user