Пример #1
0
        public void Part1()
        {
            AdapterTester         adapterTester = new AdapterTester(StringListRetriever.Retreive("InputList10.txt").Select(x => int.Parse(x)).ToList());
            Dictionary <int, int> results       = adapterTester.ComputeJoltageDifferences();
            int answer = results[1] * (results[3] + 1);

            Assert.Equal(1914, answer);
        }
Пример #2
0
        public void Part1Sample()
        {
            AdapterTester         smallDataSetTester  = new AdapterTester(GetSmallSampleDataSet());
            Dictionary <int, int> smallDataSetResults = smallDataSetTester.ComputeJoltageDifferences();

            Assert.Equal(7, smallDataSetResults[1]);
            Assert.Equal(4, smallDataSetResults[3]);
            AdapterTester         largeDataSetTester  = new AdapterTester(GetLargeSampleDataSet());
            Dictionary <int, int> largeDataSetResults = largeDataSetTester.ComputeJoltageDifferences();

            Assert.Equal(22, largeDataSetResults[1]);
            Assert.Equal(9, largeDataSetResults[3]);
        }