Example #1
0
        public void ShouldReturnCorrectAccumulator(string datafile, int result)
        {
            List <string> input = ParseInput(datafile);

            using (AOC aoc = new AOC())
            {
                var data        = aoc.ProcessData(input);
                int accumulator = aoc.ExecuteInstructions(data);
                Assert.Equal(result, accumulator);
            }
        }
Example #2
0
        public void ShouldFindValidInstructionSet(string datafile, int result)
        {
            List <string> input = ParseInput(datafile);

            using (AOC aoc = new AOC())
            {
                var data = aoc.ProcessData(input);
                var validInstructions = aoc.FindValidInstructionSet(data);
                Assert.Equal(true, aoc.ValidateInstructions(validInstructions));
                int accumulator = aoc.ExecuteInstructions(validInstructions);
                Assert.Equal(result, accumulator);
            }
        }