public void TestGetSurroundingInctiveCubes() { List <int[]> activeCubes = CubeSimulator.GetActiveCubes(this.testData); List <int[]> inactiveCubes = CubeSimulator.GetSurroundingInactive(activeCubes); Assert.AreEqual(61, inactiveCubes.Count); }
public void TestGetSurroundingActiveCubes() { List <int[]> activeCubes = CubeSimulator.GetActiveCubes(this.testData); int noOfActive = CubeSimulator.GetSurroundingActive(activeCubes[0], activeCubes); Assert.AreEqual(1, noOfActive); }
public void TestGetActiveInitialStates(int iCube, int[] expectedCoordinates) { List <int[]> activeCubes = CubeSimulator.GetActiveCubes(this.testData); Assert.AreEqual(5, activeCubes.Count); Assert.AreEqual(expectedCoordinates, activeCubes[iCube]); }
public void Setup() { var cubesim = new CubeSimulator(); this.testData = cubesim.GetInputDataMap(FilePathTestData); this.inputData = cubesim.GetInputDataMap(FilePathInputData); }
public void TestGetInitialState() { char[,,] initialState = CubeSimulator.GetInitialState(this.testData); Assert.AreEqual(3, initialState.GetLength(0)); Assert.AreEqual(3, initialState.GetLength(1)); Assert.AreEqual(3, initialState.GetLength(2)); Assert.AreEqual('.', initialState[0, 0, 0]); Assert.AreEqual('#', initialState[0, 1, 0]); }
public void FindAnswerDaySeventeenPuzzleOne() { List <int[]> activeCubes = CubeSimulator.Simulate(this.inputData, 6); Assert.AreEqual(448, activeCubes.Count); }
public void TestSimulate(int simulationSteps, int expectedActive) { List <int[]> activeCubes = CubeSimulator.Simulate(this.testData, simulationSteps); Assert.AreEqual(expectedActive, activeCubes.Count); }