Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static org.evosuite.runtime.EvoAssertions.assertThrownBy;
- import static org.junit.Assert.assertEquals;
- import static org.junit.Assert.assertFalse;
- import static org.junit.Assert.assertNotSame;
- import static org.junit.Assert.assertNull;
- import static org.junit.Assert.assertTrue;
- import static org.junit.Assert.fail;
- import java.util.ArrayList;
- import java.util.ConcurrentModificationException;
- import java.util.HashMap;
- import org.junit.Test;
- public class PlayerTest {
- @Test
- public void test00() throws Throwable {
- Player player0 = new Player();
- player0.setCanMove(true);
- boolean boolean0 = player0.isCanMove();
- assertTrue(boolean0);
- }
- @Test
- public void test01() throws Throwable {
- Player player0 = new Player();
- player0.setCanCastSpells(true);
- boolean boolean0 = player0.isCanCastSpells();
- assertTrue(boolean0);
- }
- @Test
- public void test02() throws Throwable {
- Player player0 = new Player();
- player0.setSpellList((ArrayList<Spell>) null);
- ArrayList<Spell> arrayList0 = player0.getSpellList();
- assertNull(arrayList0);
- }
- @Test
- public void test03() throws Throwable {
- Player player0 = new Player();
- player0.setPlayerAilments((HashMap<StatusAilments, Boolean>) null);
- HashMap<StatusAilments, Boolean> hashMap0 = player0.getPlayerAilments();
- assertNull(hashMap0);
- }
- @Test
- public void test04() throws Throwable {
- Player player0 = new Player();
- player0.setHealth(1289.5654484131);
- double double0 = player0.getHealth();
- assertEquals(1289.5654484131, double0, 0.01D);
- }
- @Test
- public void test05() throws Throwable {
- Player player0 = new Player();
- player0.setHealth((-1176.6));
- double double0 = player0.getHealth();
- assertEquals((-1176.6), double0, 0.01D);
- }
- @Test
- public void test06() throws Throwable {
- Player player0 = new Player();
- player0.takeDamage(269.8124634603967);
- player0.setHealth(100.0);
- player0.checkPlayerStatus();
- assertEquals(100.0, player0.getHealth(), 0.01D);
- }
- @Test
- public void test07() throws Throwable {
- Player player0 = new Player();
- player0.setHealth((-136.31098));
- player0.heal((-136.31098));
- assertEquals((-136.31098), player0.getHealth(), 0.01D);
- }
- @Test
- public void test08() throws Throwable {
- Player player0 = new Player();
- player0.setHealth((-1312.0));
- player0.takeDamage((-1505.43215));
- assertEquals((-1312.0), player0.getHealth(), 0.01D);
- }
- @Test
- public void test09() throws Throwable {
- Player player0 = new Player();
- Spell spell0 = new Spell();
- player0.addSpell(spell0);
- Spell spell1 = new Spell();
- spell1.setSpellID(3965);
- player0.removeSpell(spell1);
- assertFalse(player0.isCanCastSpells());
- }
- @Test
- public void test10() throws Throwable {
- Player player0 = new Player();
- player0.setPlayerAilments((HashMap<StatusAilments, Boolean>) null);
- // Undeclared exception!
- try {
- player0.takeDamage(100.0);
- fail("Expecting exception: NullPointerException");
- } catch(NullPointerException e) {
- //
- // no message in exception (getMessage() returned null)
- //
- assertThrownBy("Week4.Player", e);
- }
- }
- @Test
- public void test11() throws Throwable {
- Player player0 = new Player();
- player0.addSpell((Spell) null);
- Spell spell0 = new Spell();
- // Undeclared exception!
- try {
- player0.removeSpell(spell0);
- fail("Expecting exception: NullPointerException");
- } catch(NullPointerException e) {
- //
- // no message in exception (getMessage() returned null)
- //
- assertThrownBy("Week4.Player", e);
- }
- }
- @Test
- public void test12() throws Throwable {
- Player player0 = new Player();
- HashMap<StatusAilments, Boolean> hashMap0 = new HashMap<StatusAilments, Boolean>();
- StatusAilments statusAilments0 = StatusAilments.FROZEN;
- player0.setHealth((-136.31098));
- Boolean boolean0 = Boolean.valueOf(false);
- StatusAilments statusAilments1 = StatusAilments.POISONED;
- hashMap0.put(statusAilments1, boolean0);
- hashMap0.put(statusAilments0, boolean0);
- player0.setPlayerAilments(hashMap0);
- }
- @Test
- public void test13() throws Throwable {
- Player player0 = new Player();
- player0.setPlayerAilments((HashMap<StatusAilments, Boolean>) null);
- // Undeclared exception!
- try {
- player0.checkPlayerStatus();
- fail("Expecting exception: NullPointerException");
- } catch(NullPointerException e) {
- //
- // no message in exception (getMessage() returned null)
- //
- assertThrownBy("Week4.Player", e);
- }
- }
- @Test
- public void test14() throws Throwable {
- Player player0 = new Player();
- player0.setSpellList((ArrayList<Spell>) null);
- Spell spell0 = new Spell();
- try {
- player0.addSpell(spell0);
- fail("Expecting exception: NullPointerException");
- } catch(NullPointerException e) {
- //
- // no message in exception (getMessage() returned null)
- //
- assertThrownBy("Week4.Player", e);
- }
- }
- @Test
- public void test15() throws Throwable {
- Player player0 = new Player();
- HashMap<StatusAilments, Boolean> hashMap0 = new HashMap<StatusAilments, Boolean>();
- player0.setPlayerAilments(hashMap0);
- StatusAilments statusAilments0 = StatusAilments.FROZEN;
- player0.setHealth((-136.31098));
- Boolean boolean0 = Boolean.valueOf(false);
- hashMap0.put(statusAilments0, boolean0);
- player0.checkPlayerStatus();
- assertEquals((-136.31098), player0.getHealth(), 0.01D);
- }
- @Test
- public void test16() throws Throwable {
- Player player0 = new Player();
- HashMap<StatusAilments, Boolean> hashMap0 = new HashMap<StatusAilments, Boolean>();
- StatusAilments statusAilments0 = StatusAilments.STUNNED;
- Boolean boolean0 = new Boolean(false);
- hashMap0.put(statusAilments0, boolean0);
- player0.setPlayerAilments(hashMap0);
- player0.checkPlayerStatus();
- assertFalse(player0.isCanCastSpells());
- }
- @Test
- public void test17() throws Throwable {
- Player player0 = new Player();
- player0.setHealth(89.28252779732192);
- player0.heal((-21));
- assertEquals(68.28252779732192, player0.getHealth(), 0.01D);
- }
- @Test
- public void test18() throws Throwable {
- Player player0 = new Player();
- player0.setHealth(236.98875);
- player0.heal(236.98875);
- assertEquals(236.98875, player0.getHealth(), 0.01D);
- }
- @Test
- public void test19() throws Throwable {
- Player player0 = new Player();
- player0.heal((-2077.9443850649977));
- assertEquals(0.0, player0.getHealth(), 0.01D);
- }
- @Test
- public void test20() throws Throwable {
- Player player0 = new Player();
- player0.setHealth(100.0);
- player0.takeDamage((-1303.8448788700687));
- assertEquals(1403.8448788700687, player0.getHealth(), 0.01D);
- }
- @Test
- public void test21() throws Throwable {
- Player player0 = new Player();
- Spell spell0 = new Spell();
- spell0.setSpellID(3);
- player0.addSpell(spell0);
- Spell spell1 = new Spell();
- player0.removeSpell(spell1);
- assertNotSame(spell1, spell0);
- }
- @Test
- public void test22() throws Throwable {
- Player player0 = new Player();
- Spell spell0 = new Spell();
- player0.addSpell(spell0);
- // Undeclared exception!
- try {
- player0.removeSpell(spell0);
- fail("Expecting exception: ConcurrentModificationException");
- } catch(ConcurrentModificationException e) {
- //
- // no message in exception (getMessage() returned null)
- //
- assertThrownBy("java.util.ArrayList$Itr", e);
- }
- }
- @Test
- public void test23() throws Throwable {
- Player player0 = new Player();
- Spell spell0 = new Spell();
- ArrayList<Spell> arrayList0 = new ArrayList<Spell>();
- arrayList0.add(spell0);
- arrayList0.add(spell0);
- player0.setSpellList(arrayList0);
- arrayList0.add(spell0);
- player0.addSpell(spell0);
- try {
- player0.addSpell(spell0);
- fail("Expecting exception: Exception");
- } catch(Exception e) {
- //
- // Sorry, you can only have a maximum of 4 spells
- //
- assertThrownBy("Week4.Player", e);
- }
- }
- @Test
- public void test24() throws Throwable {
- Player player0 = new Player();
- boolean boolean0 = player0.isCanCastSpells();
- assertFalse(boolean0);
- }
- @Test
- public void test25() throws Throwable {
- Player player0 = new Player();
- double double0 = player0.getHealth();
- assertEquals(0.0, double0, 0.01D);
- }
- @Test
- public void test26() throws Throwable {
- Player player0 = new Player();
- boolean boolean0 = player0.isCanMove();
- assertFalse(boolean0);
- }
- @Test
- public void test27() throws Throwable {
- Player player0 = new Player();
- ArrayList<Spell> arrayList0 = player0.getSpellList();
- player0.setSpellList(arrayList0);
- assertTrue(arrayList0.isEmpty());
- }
- @Test
- public void test28() throws Throwable {
- Player player0 = new Player();
- HashMap<StatusAilments, Boolean> hashMap0 = player0.getPlayerAilments();
- StatusAilments statusAilments0 = StatusAilments.BURNING;
- Boolean boolean0 = Boolean.TRUE;
- hashMap0.put(statusAilments0, boolean0);
- player0.checkPlayerStatus();
- assertFalse(player0.isCanCastSpells());
- }
- @Test
- public void test29() throws Throwable {
- Player player0 = new Player();
- HashMap<StatusAilments, Boolean> hashMap0 = new HashMap<StatusAilments, Boolean>();
- Boolean boolean0 = Boolean.valueOf(true);
- StatusAilments statusAilments1 = StatusAilments.POISONED;
- hashMap0.put(statusAilments1, boolean0);
- player0.setPlayerAilments(hashMap0);
- player0.checkPlayerStatus();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement