示例#1
0
        public void TestCreateInstructionList()
        {
            string[]            testData        = BootExecutor.GetInputData(FilePathTestData);
            List <BootExecutor> instructionList = BootExecutor.CreateInstructionList(testData);

            Assert.AreEqual(9, instructionList.Count);
        }
示例#2
0
        public void FindAnswerDayEightPuzzleOne()
        {
            string[]            testData        = BootExecutor.GetInputData(FilePathInputData);
            List <BootExecutor> instructionList = BootExecutor.CreateInstructionList(testData);
            int accumulator = BootExecutor.RunBoot(instructionList);

            Assert.AreEqual(1797, accumulator);
        }
示例#3
0
        public void TestRunBoot()
        {
            string[]            testData        = BootExecutor.GetInputData(FilePathTestData);
            List <BootExecutor> instructionList = BootExecutor.CreateInstructionList(testData);
            int accumulator = BootExecutor.RunBoot(instructionList);

            Assert.AreEqual(5, accumulator);
        }
示例#4
0
        public void TestBootExecutorConstructor()
        {
            var instruction = new BootExecutor("nop +0");

            Assert.AreEqual("nop", instruction.Instruction);
            Assert.AreEqual(0, instruction.Argument);
            Assert.AreEqual(0, instruction.Visits);
        }
示例#5
0
        public void FindAnswerDayEightPuzzleTwo()
        {
            string[]            testData        = BootExecutor.GetInputData(FilePathInputData2);
            List <BootExecutor> instructionList = BootExecutor.CreateInstructionList(testData);
            int accumulator = BootExecutor.RunBoot(instructionList);

            Assert.Warn("Not solved");

            // Assert.Less(accumulator, 1752);
            // Assert.AreEqual(1797, accumulator);
        }
示例#6
0
 public void TestGetInputData()
 {
     string[] testData = BootExecutor.GetInputData(FilePathTestData);
     Assert.AreEqual(9, testData.GetLength(0));
     Assert.AreEqual("nop +0", testData[0]);
 }