Ejemplo n.º 1
0
        public void TestGetSurroundingInctiveCubes()
        {
            List <int[]> activeCubes   = CubeSimulator.GetActiveCubes(this.testData);
            List <int[]> inactiveCubes = CubeSimulator.GetSurroundingInactive(activeCubes);

            Assert.AreEqual(61, inactiveCubes.Count);
        }
Ejemplo n.º 2
0
        public void TestGetSurroundingActiveCubes()
        {
            List <int[]> activeCubes = CubeSimulator.GetActiveCubes(this.testData);
            int          noOfActive  = CubeSimulator.GetSurroundingActive(activeCubes[0], activeCubes);

            Assert.AreEqual(1, noOfActive);
        }
Ejemplo n.º 3
0
        public void TestGetActiveInitialStates(int iCube, int[] expectedCoordinates)
        {
            List <int[]> activeCubes = CubeSimulator.GetActiveCubes(this.testData);

            Assert.AreEqual(5, activeCubes.Count);
            Assert.AreEqual(expectedCoordinates, activeCubes[iCube]);
        }
Ejemplo n.º 4
0
        public void Setup()
        {
            var cubesim = new CubeSimulator();

            this.testData  = cubesim.GetInputDataMap(FilePathTestData);
            this.inputData = cubesim.GetInputDataMap(FilePathInputData);
        }
Ejemplo n.º 5
0
 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]);
 }
Ejemplo n.º 6
0
        public void FindAnswerDaySeventeenPuzzleOne()
        {
            List <int[]> activeCubes = CubeSimulator.Simulate(this.inputData, 6);

            Assert.AreEqual(448, activeCubes.Count);
        }
Ejemplo n.º 7
0
        public void TestSimulate(int simulationSteps, int expectedActive)
        {
            List <int[]> activeCubes = CubeSimulator.Simulate(this.testData, simulationSteps);

            Assert.AreEqual(expectedActive, activeCubes.Count);
        }