package ge.edu.freeuni.sdp.snake.presenter;

import static org.junit.Assert.*;
import ge.edu.freeuni.sdp.snake.model.BeingKind;
import ge.edu.freeuni.sdp.snake.model.Direction;
import ge.edu.freeuni.sdp.snake.model.GameFacade;
import ge.edu.freeuni.sdp.snake.model.Point;
import ge.edu.freeuni.sdp.snake.model.Size;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;

public class MazePresenterTest {

	private static GameFacade game;
	private static MazePresenter mazePresenter;

	@Before
	public void setUp() throws Exception {
		game = Mockito.mock(GameFacade.class);
		Mockito.when(game.getSize()).thenReturn(new Size(10, 10));
		mazePresenter = Mockito.spy(new MazePresenter(game));
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testSetCellUpdateListener() {

	}

	@Test
	public void testIsGameOver() {

	}

	@Test
	public void testTick() {

	}

	@Test
	public void testSetLivesUpdateListener() {

	}

	@Test
	public void testSaveState() {

	}

	@Test
	public void testRestoreState() {

	}

}

@@ -72,16 +72,39 @@
 sert.*;%0A
+%0Aimport java.io.File;%0A%0A
 import g
@@ -144,16 +144,65 @@
 ngKind;%0A
+import ge.edu.freeuni.sdp.snake.model.Caretaker;%0A
 import g
@@ -292,16 +292,63 @@
 Facade;%0A
+import ge.edu.freeuni.sdp.snake.model.Memento;%0A
 import g
@@ -501,16 +501,41 @@
 t.Test;%0A
+import org.mockito.Mock;%0A
 import o
@@ -609,160 +609,431 @@
 tic 
-GameFacade game;%0A%09private static MazePresenter mazePresenter;%0A%0A%09@Before%0A%09public void setUp() throws Exception %7B%0A%09%09game = Mockito.mock(GameFacade.class);
+File file;%0A%09private static Size size;%0A%09private static Caretaker care;%0A%09private static GameFacade game;%0A%09private static Memento memento;%0A%09private static MazePresenter mazePresenter;%0A%0A%09@Before%0A%09public void setUp() throws Exception %7B%0A%09%09file = Mockito.mock(File.class);%0A%09%09size = Mockito.mock(Size.class);%0A%09%09care = Mockito.mock(Caretaker.class);%0A%09%09game = Mockito.mock(GameFacade.class);%0A%09%09memento = Mockito.mock(Memento.class);%0A
 %0A%09%09M
@@ -1048,53 +1048,188 @@
 hen(
-gam
+siz
 e.get
-Size()).thenReturn(new Size(10, 10));
+Height()).thenReturn(10);%0A%09%09Mockito.when(size.getWidth()).thenReturn(10);%0A%09%09Mockito.when(file.exists()).thenReturn(false);%0A%09%09Mockito.when(game.getSize()).thenReturn(size);%0A
 %0A%09%09m
@@ -1277,16 +1277,28 @@
 ter(game
+, file, care
 ));%0A%09%7D%0A%0A
@@ -1299,21 +1299,20 @@
 ;%0A%09%7D%0A%0A%09@
-After
+Test
 %0A%09public
@@ -1323,35 +1323,661 @@
 d te
-arDown() throws Exception %7B
+stMazePresenterFileExists() %7B%0A%09%09Mockito.when(file.exists()).thenReturn(true);%0A%09%09Mockito.when(care.getMemento()).thenReturn(memento);%0A%09%09mazePresenter = new MazePresenter(game, file, care);%0A%09%09Mockito.verify(file, Mockito.atLeastOnce()).exists();%0A%09%09Mockito.verify(care).getMemento();%0A%09%7D%0A%0A%09@Test%0A%09public void testMazePresenterFileNotExists() %7B%0A%09%09mazePresenter = new MazePresenter(game, file, care);%0A%09%09Mockito.verify(file, Mockito.atLeastOnce()).exists();%0A%09%09Mockito.verify(care, Mockito.never()).getMemento();%0A%09%7D%0A%0A%09@Test%0A%09public void testMazePresenterOld() %7B%0A%09%09mazePresenter = new MazePresenter(game);%0A%09%09Mockito.verify(game, Mockito.atLeastOnce()).getSize();
 %0A%09%7D%0A

Update MazePresenterTest.java