예제 #1
0
        public void ParseInput_MapSize()
        {
            var map = Problem3.ParseInputToMap(Input);

            Assert.AreEqual(11, map.GetLength(0));
            Assert.AreEqual(11, map.GetLength(1));
        }
예제 #2
0
        public void ParseInput_MapParsing()
        {
            var map = Problem3.ParseInputToMap(Input);

            Assert.IsFalse(map[0, 0]);
            Assert.IsTrue(map[0, 1]);
            Assert.IsTrue(map[10, 10]);
        }
예제 #3
0
        public void PartTwoTest()
        {
            var map = Problem3.ParseInputToMap(Input);

            var total = Problem3.CountHits(map, 1, 1);

            total *= Problem3.CountHits(map, 3, 1);
            total *= Problem3.CountHits(map, 5, 1);
            total *= Problem3.CountHits(map, 7, 1);
            total *= Problem3.CountHits(map, 1, 2);

            Assert.AreEqual(336, total);
        }
예제 #4
0
 public void TestSlope(int xSpeed, int ySpeed, int expectedTrees)
 {
     Assert.AreEqual(expectedTrees, Problem3.CountHits(Problem3.ParseInputToMap(Input), xSpeed, ySpeed));
 }