@@ -0,0 +1,1836 @@
+package nl.joshuaslik.tudelft.SEM.control.gameObjects;%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.times;%0A%0Aimport java.util.Random;%0A%0Aimport nl.joshuaslik.tudelft.SEM.control.gameObjects.pickup.Coin;%0Aimport nl.joshuaslik.tudelft.SEM.control.gameObjects.pickup.Life;%0Aimport nl.joshuaslik.tudelft.SEM.control.gameObjects.pickup.PickupGenerator;%0Aimport nl.joshuaslik.tudelft.SEM.control.gameObjects.pickup.powerup.Powerup;%0Aimport nl.joshuaslik.tudelft.SEM.model.container.Point;%0A%0Aimport org.junit.Test;%0Aimport org.mockito.Mockito;%0A%0Apublic class PickupGeneratorTest %7B%0A%0A%09IGameObjects igo = Mockito.mock(IGameObjects.class);%0A%09Point p = Mockito.mock(Point.class);%0A%09Powerup powerup = Mockito.mock(Powerup.class);%0A%09PickupGenerator pg = new PickupGenerator(igo);%0A%09Coin coin = Mockito.mock(Coin.class);%0A%09Life life = Mockito.mock(Life.class);%0A%09%0A//%09@Test%0A%09public void testNoPickup() %7B%0A%09%09Random rand = new Random();%0A%09%09while(rand.nextBoolean())%7B%0A%09%09%09rand = new Random();%0A%09%09%7D%0A%09%09pg.generatePickup(p);%0A%09%09verify(igo, times(0)).addObject(powerup);%0A%09%7D%0A%09%0A//%09@Test%0A%09public void testPowerup() %7B%0A%09%09Random rand = new Random();%0A%09%09while(!(rand.nextDouble() %3C 0.6 && rand.nextBoolean())) %7B%0A%09%09%09rand = new Random();%0A%09%09%7D%0A%09%09%0A%09%09pg.generatePickup(p);%0A%09%09verify(igo, times(1)).addObject(powerup);%0A%09%7D%0A%09%0A//%09@Test%0A%09public void testCoin() %7B%0A%09%09Random rand = new Random();%0A%09%09while(!(rand.nextBoolean() && !(rand.nextDouble() %3C 0.6) && rand.nextDouble() %3C 0.5))%7B%0A%09%09%09rand = new Random();%0A%09%09%7D%0A%09%09pg.generatePickup(p);%0A%09%09verify(igo, times(1)).addObject(coin);%0A%09%7D%0A%0A//%09@Test%0A%09public void testLife() %7B%0A%09%09Random rand = new Random();%0A%09%09while(!(rand.nextBoolean() && !(rand.nextDouble() %3C 0.6) && !(rand.nextDouble() %3C 0.5)))%7B%0A%09%09%09rand = new Random();%0A%09%09%7D%0A%09%09pg.generatePickup(p);%0A%09%09verify(igo, times(1)).addObject(life);%0A%09%7D%0A%7D%0A

Add PickupGeneratorTest