@@ -0,0 +1,2786 @@
+package com.mikeburke106.mines.basic.model;%0A%0Aimport com.mikeburke106.mines.api.model.Position;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mock;%0A%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.Mockito.when;%0Aimport static org.mockito.MockitoAnnotations.initMocks;%0A%0A/**%0A * Created by Mike on 4/18/2017.%0A */%0Apublic class BasicFieldTest %7B%0A    // %5B %5D%5Bx%5D%5B %5D%0A    // %5Bx%5D%5BxP%5D%5BP%5D%0A    private static final int MOCK_WIDTH = 3;%0A    private static final int MOCK_HEIGHT = 2;%0A%0A    @Mock%0A    private BasicPosition mockPosition0, mockPosition1, mockPosition2,%0A            mockPosition3, mockPosition4, mockPosition5;%0A%0A    @Mock%0A    private BasicConfiguration mockConfiguration;%0A%0A    private Position.Pool mockPositionPool;%0A%0A    private BasicField basicField;%0A%0A    @Before%0A    public void setup() %7B%0A        initMocks(this);%0A%0A        Set%3CPosition%3E mockMineSet = new HashSet%3C%3E(3);%0A        mockMineSet.add(mockPosition1);%0A        mockMineSet.add(mockPosition3);%0A        mockMineSet.add(mockPosition4);%0A%0A        Set%3CPosition%3E mockFlagSet = new HashSet%3C%3E(3);%0A        mockFlagSet.add(mockPosition4);%0A        mockFlagSet.add(mockPosition5);%0A%0A        mockPositionPool = new BasicPositionPool(new Position%5B%5D%7BmockPosition0, mockPosition1, mockPosition2,%0A                mockPosition3, mockPosition4, mockPosition5%7D, MOCK_WIDTH, MOCK_HEIGHT);%0A%0A        when(mockConfiguration.positionPool()).thenReturn(mockPositionPool);%0A%0A        basicField = new BasicField(mockConfiguration, mockMineSet, mockFlagSet);%0A    %7D%0A%0A    @Test%0A    public void testConfiguration() %7B%0A        assertEquals(basicField.configuration(), mockConfiguration);%0A    %7D%0A%0A    @Test%0A    public void testClearEmptyPosition() %7B%0A        assertFalse(basicField.clear(mockPosition0));%0A    %7D%0A%0A    @Test%0A    public void testClearMinePosition() %7B%0A        assertTrue(basicField.clear(mockPosition1));%0A    %7D%0A%0A    @Test%0A    public void testClearFlagPosition() %7B%0A        assertFalse(basicField.flag(mockPosition5));%0A    %7D%0A%0A    @Test%0A    public void testSetFlagPosition() %7B%0A        assertTrue(basicField.flag(mockPosition2));%0A    %7D%0A%0A    @Test%0A    public void testIsFlagTrue() %7B%0A        assertTrue(basicField.isFlag(mockPosition4));%0A    %7D%0A%0A    @Test%0A    public void testIsFlagFalse() %7B%0A        assertFalse(basicField.isFlag(mockPosition3));%0A    %7D%0A%0A    @Test%0A    public void testIsMineTrue() %7B%0A        assertTrue(basicField.isMine(mockPosition3));%0A    %7D%0A%0A    @Test%0A    public void testIsMineFalse() %7B%0A        assertFalse(basicField.isMine(mockPosition0));%0A    %7D%0A%0A    @Test%0A    public void testToString() %7B%0A        assertEquals(%22%5B %5D%5Bx%5D%5B %5D%5Cn%5Bx%5D%5Bx%5D%5B %5D%5Cn%22, basicField.toString());%0A    %7D%0A%7D%0A

add basic field unit test