コード例 #1
0
        public void Day02_Puzzle1_OK()
        {
            var    sut      = new DivePathFinder();
            var    cmds     = Utils.ReadLinesFromFile("Day02.txt");
            string expected = "forward 2";

            Assert.Equal(expected, cmds[cmds.Length - 1]);

            long actual = sut.FindPosition(cmds);

            //Assert.Equal(15, sut.Horizontal);
            //Assert.Equal(10, sut.Depth);
            Assert.Equal(1480518, actual);
        }
コード例 #2
0
        public void Day02_TestPath_OK()
        {
            var    sut      = new DivePathFinder();
            string expected = "forward 2";

            Assert.Equal(expected, tcmds[tcmds.Length - 1]);

            //            int increases = sut.SimpleIncreases(depths);
            long actual = sut.FindPosition(tcmds);

            Assert.Equal(15, sut.Horizontal);
            Assert.Equal(10, sut.Depth);
            Assert.Equal(150, actual);
        }