Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.31 KB | None | 0 0
  1. import static org.evosuite.runtime.EvoAssertions.assertThrownBy;
  2. import static org.junit.Assert.assertEquals;
  3. import static org.junit.Assert.assertFalse;
  4. import static org.junit.Assert.assertNotSame;
  5. import static org.junit.Assert.assertNull;
  6. import static org.junit.Assert.assertTrue;
  7. import static org.junit.Assert.fail;
  8.  
  9. import java.util.ArrayList;
  10. import java.util.ConcurrentModificationException;
  11. import java.util.HashMap;
  12.  
  13. import org.junit.Test;
  14.  
  15. public class PlayerTest {
  16. @Test
  17. public void test00() throws Throwable {
  18. Player player0 = new Player();
  19. player0.setCanMove(true);
  20. boolean boolean0 = player0.isCanMove();
  21. assertTrue(boolean0);
  22. }
  23.  
  24. @Test
  25. public void test01() throws Throwable {
  26. Player player0 = new Player();
  27. player0.setCanCastSpells(true);
  28. boolean boolean0 = player0.isCanCastSpells();
  29. assertTrue(boolean0);
  30. }
  31.  
  32. @Test
  33. public void test02() throws Throwable {
  34. Player player0 = new Player();
  35. player0.setSpellList((ArrayList<Spell>) null);
  36. ArrayList<Spell> arrayList0 = player0.getSpellList();
  37. assertNull(arrayList0);
  38. }
  39.  
  40. @Test
  41. public void test03() throws Throwable {
  42. Player player0 = new Player();
  43. player0.setPlayerAilments((HashMap<StatusAilments, Boolean>) null);
  44. HashMap<StatusAilments, Boolean> hashMap0 = player0.getPlayerAilments();
  45. assertNull(hashMap0);
  46. }
  47.  
  48. @Test
  49. public void test04() throws Throwable {
  50. Player player0 = new Player();
  51. player0.setHealth(1289.5654484131);
  52. double double0 = player0.getHealth();
  53. assertEquals(1289.5654484131, double0, 0.01D);
  54. }
  55.  
  56. @Test
  57. public void test05() throws Throwable {
  58. Player player0 = new Player();
  59. player0.setHealth((-1176.6));
  60. double double0 = player0.getHealth();
  61. assertEquals((-1176.6), double0, 0.01D);
  62. }
  63.  
  64. @Test
  65. public void test06() throws Throwable {
  66. Player player0 = new Player();
  67. player0.takeDamage(269.8124634603967);
  68. player0.setHealth(100.0);
  69. player0.checkPlayerStatus();
  70. assertEquals(100.0, player0.getHealth(), 0.01D);
  71. }
  72.  
  73. @Test
  74. public void test07() throws Throwable {
  75. Player player0 = new Player();
  76. player0.setHealth((-136.31098));
  77. player0.heal((-136.31098));
  78. assertEquals((-136.31098), player0.getHealth(), 0.01D);
  79. }
  80.  
  81. @Test
  82. public void test08() throws Throwable {
  83. Player player0 = new Player();
  84. player0.setHealth((-1312.0));
  85. player0.takeDamage((-1505.43215));
  86. assertEquals((-1312.0), player0.getHealth(), 0.01D);
  87. }
  88.  
  89. @Test
  90. public void test09() throws Throwable {
  91. Player player0 = new Player();
  92. Spell spell0 = new Spell();
  93. player0.addSpell(spell0);
  94. Spell spell1 = new Spell();
  95. spell1.setSpellID(3965);
  96. player0.removeSpell(spell1);
  97. assertFalse(player0.isCanCastSpells());
  98. }
  99.  
  100. @Test
  101. public void test10() throws Throwable {
  102. Player player0 = new Player();
  103. player0.setPlayerAilments((HashMap<StatusAilments, Boolean>) null);
  104. // Undeclared exception!
  105. try {
  106. player0.takeDamage(100.0);
  107. fail("Expecting exception: NullPointerException");
  108.  
  109. } catch(NullPointerException e) {
  110. //
  111. // no message in exception (getMessage() returned null)
  112. //
  113. assertThrownBy("Week4.Player", e);
  114. }
  115. }
  116.  
  117. @Test
  118. public void test11() throws Throwable {
  119. Player player0 = new Player();
  120. player0.addSpell((Spell) null);
  121. Spell spell0 = new Spell();
  122. // Undeclared exception!
  123. try {
  124. player0.removeSpell(spell0);
  125. fail("Expecting exception: NullPointerException");
  126.  
  127. } catch(NullPointerException e) {
  128. //
  129. // no message in exception (getMessage() returned null)
  130. //
  131. assertThrownBy("Week4.Player", e);
  132. }
  133. }
  134.  
  135. @Test
  136. public void test12() throws Throwable {
  137. Player player0 = new Player();
  138. HashMap<StatusAilments, Boolean> hashMap0 = new HashMap<StatusAilments, Boolean>();
  139. StatusAilments statusAilments0 = StatusAilments.FROZEN;
  140. player0.setHealth((-136.31098));
  141. Boolean boolean0 = Boolean.valueOf(false);
  142. StatusAilments statusAilments1 = StatusAilments.POISONED;
  143. hashMap0.put(statusAilments1, boolean0);
  144. hashMap0.put(statusAilments0, boolean0);
  145. player0.setPlayerAilments(hashMap0);
  146. }
  147.  
  148. @Test
  149. public void test13() throws Throwable {
  150. Player player0 = new Player();
  151. player0.setPlayerAilments((HashMap<StatusAilments, Boolean>) null);
  152. // Undeclared exception!
  153. try {
  154. player0.checkPlayerStatus();
  155. fail("Expecting exception: NullPointerException");
  156.  
  157. } catch(NullPointerException e) {
  158. //
  159. // no message in exception (getMessage() returned null)
  160. //
  161. assertThrownBy("Week4.Player", e);
  162. }
  163. }
  164.  
  165. @Test
  166. public void test14() throws Throwable {
  167. Player player0 = new Player();
  168. player0.setSpellList((ArrayList<Spell>) null);
  169. Spell spell0 = new Spell();
  170. try {
  171. player0.addSpell(spell0);
  172. fail("Expecting exception: NullPointerException");
  173.  
  174. } catch(NullPointerException e) {
  175. //
  176. // no message in exception (getMessage() returned null)
  177. //
  178. assertThrownBy("Week4.Player", e);
  179. }
  180. }
  181.  
  182. @Test
  183. public void test15() throws Throwable {
  184. Player player0 = new Player();
  185. HashMap<StatusAilments, Boolean> hashMap0 = new HashMap<StatusAilments, Boolean>();
  186. player0.setPlayerAilments(hashMap0);
  187. StatusAilments statusAilments0 = StatusAilments.FROZEN;
  188. player0.setHealth((-136.31098));
  189. Boolean boolean0 = Boolean.valueOf(false);
  190. hashMap0.put(statusAilments0, boolean0);
  191. player0.checkPlayerStatus();
  192. assertEquals((-136.31098), player0.getHealth(), 0.01D);
  193. }
  194.  
  195. @Test
  196. public void test16() throws Throwable {
  197. Player player0 = new Player();
  198. HashMap<StatusAilments, Boolean> hashMap0 = new HashMap<StatusAilments, Boolean>();
  199. StatusAilments statusAilments0 = StatusAilments.STUNNED;
  200. Boolean boolean0 = new Boolean(false);
  201. hashMap0.put(statusAilments0, boolean0);
  202. player0.setPlayerAilments(hashMap0);
  203. player0.checkPlayerStatus();
  204. assertFalse(player0.isCanCastSpells());
  205. }
  206.  
  207. @Test
  208. public void test17() throws Throwable {
  209. Player player0 = new Player();
  210. player0.setHealth(89.28252779732192);
  211. player0.heal((-21));
  212. assertEquals(68.28252779732192, player0.getHealth(), 0.01D);
  213. }
  214.  
  215. @Test
  216. public void test18() throws Throwable {
  217. Player player0 = new Player();
  218. player0.setHealth(236.98875);
  219. player0.heal(236.98875);
  220. assertEquals(236.98875, player0.getHealth(), 0.01D);
  221. }
  222.  
  223. @Test
  224. public void test19() throws Throwable {
  225. Player player0 = new Player();
  226. player0.heal((-2077.9443850649977));
  227. assertEquals(0.0, player0.getHealth(), 0.01D);
  228. }
  229.  
  230. @Test
  231. public void test20() throws Throwable {
  232. Player player0 = new Player();
  233. player0.setHealth(100.0);
  234. player0.takeDamage((-1303.8448788700687));
  235. assertEquals(1403.8448788700687, player0.getHealth(), 0.01D);
  236. }
  237.  
  238. @Test
  239. public void test21() throws Throwable {
  240. Player player0 = new Player();
  241. Spell spell0 = new Spell();
  242. spell0.setSpellID(3);
  243. player0.addSpell(spell0);
  244. Spell spell1 = new Spell();
  245. player0.removeSpell(spell1);
  246. assertNotSame(spell1, spell0);
  247. }
  248.  
  249. @Test
  250. public void test22() throws Throwable {
  251. Player player0 = new Player();
  252. Spell spell0 = new Spell();
  253. player0.addSpell(spell0);
  254. // Undeclared exception!
  255. try {
  256. player0.removeSpell(spell0);
  257. fail("Expecting exception: ConcurrentModificationException");
  258.  
  259. } catch(ConcurrentModificationException e) {
  260. //
  261. // no message in exception (getMessage() returned null)
  262. //
  263. assertThrownBy("java.util.ArrayList$Itr", e);
  264. }
  265. }
  266.  
  267. @Test
  268. public void test23() throws Throwable {
  269. Player player0 = new Player();
  270. Spell spell0 = new Spell();
  271. ArrayList<Spell> arrayList0 = new ArrayList<Spell>();
  272. arrayList0.add(spell0);
  273. arrayList0.add(spell0);
  274. player0.setSpellList(arrayList0);
  275. arrayList0.add(spell0);
  276. player0.addSpell(spell0);
  277. try {
  278. player0.addSpell(spell0);
  279. fail("Expecting exception: Exception");
  280.  
  281. } catch(Exception e) {
  282. //
  283. // Sorry, you can only have a maximum of 4 spells
  284. //
  285. assertThrownBy("Week4.Player", e);
  286. }
  287. }
  288.  
  289. @Test
  290. public void test24() throws Throwable {
  291. Player player0 = new Player();
  292. boolean boolean0 = player0.isCanCastSpells();
  293. assertFalse(boolean0);
  294. }
  295.  
  296. @Test
  297. public void test25() throws Throwable {
  298. Player player0 = new Player();
  299. double double0 = player0.getHealth();
  300. assertEquals(0.0, double0, 0.01D);
  301. }
  302.  
  303. @Test
  304. public void test26() throws Throwable {
  305. Player player0 = new Player();
  306. boolean boolean0 = player0.isCanMove();
  307. assertFalse(boolean0);
  308. }
  309.  
  310. @Test
  311. public void test27() throws Throwable {
  312. Player player0 = new Player();
  313. ArrayList<Spell> arrayList0 = player0.getSpellList();
  314. player0.setSpellList(arrayList0);
  315. assertTrue(arrayList0.isEmpty());
  316. }
  317.  
  318. @Test
  319. public void test28() throws Throwable {
  320. Player player0 = new Player();
  321. HashMap<StatusAilments, Boolean> hashMap0 = player0.getPlayerAilments();
  322. StatusAilments statusAilments0 = StatusAilments.BURNING;
  323. Boolean boolean0 = Boolean.TRUE;
  324. hashMap0.put(statusAilments0, boolean0);
  325. player0.checkPlayerStatus();
  326. assertFalse(player0.isCanCastSpells());
  327. }
  328.  
  329. @Test
  330. public void test29() throws Throwable {
  331. Player player0 = new Player();
  332. HashMap<StatusAilments, Boolean> hashMap0 = new HashMap<StatusAilments, Boolean>();
  333. Boolean boolean0 = Boolean.valueOf(true);
  334. StatusAilments statusAilments1 = StatusAilments.POISONED;
  335. hashMap0.put(statusAilments1, boolean0);
  336. player0.setPlayerAilments(hashMap0);
  337. player0.checkPlayerStatus();
  338. }
  339. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement