Archived
0

добавлен тест H2Player equals

This commit is contained in:
2018-09-13 22:53:47 +03:00
parent 295a7685e8
commit 6a4855f5a9

View File

@@ -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);
}
}