1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package tests;
- import org.junit.Before;
- import org.junit.Test;
- import static org.junit.Assert.assertTrue;
- import java.util.ArrayList;
- import ui.controller.GlobalController;
- import ui.model.Model;
- /**
- * Test for the GlobalController.
- *
- * @author Gruppe14
- */
- public class PraktikumHolonsTestGlobalController {
- protected Model model;
- protected GlobalController controller;
- /**
- * Setup.
- */
- @Before
- public void setUp() {
- model = new Model();
- controller = new GlobalController(model);
- }
- /**
- * Test for GlobalControls.
- */
- @Test
- public void testGlobalControls() {
- int prevScale = controller.getScale();
- int prevScaleDiv2 = controller.getScaleDiv2();
- int prevNumberSav = controller.getNumbersOfSaves();
- boolean sim = model.getIsSimulation();
- int timer = model.getTimerSpeed();
- int it = model.getCurIteration();
- controller.setScale(100);
- controller.setNumberOfSaves(50);
- controller.setIsSimulation(true);
- controller.setTimerSpeed(2000);
- controller.setCurIteration(10);
- assertTrue("Scale was not changed", controller.getScale() != prevScale);
- assertTrue("ScaleDiv2 was not changed ", model.getScaleDiv2() != prevScaleDiv2);
- assertTrue("Number of Saves was not changed", controller.getNumbersOfSaves() != prevNumberSav);
- assertTrue("Simulation State was not Set", sim != model.getIsSimulation());
- assertTrue("Timer speed was not changed", timer != model.getTimerSpeed());
- assertTrue("Curr Iteration was not Set", it != model.getCurIteration());
- }
- }
|