예제 #1
0
파일: UnitTest1.cs 프로젝트: willoftw/AOC
        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);
            }
        }
예제 #2
0
파일: UnitTest1.cs 프로젝트: willoftw/AOC
        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);
            }
        }