示例#1
0
        public void Day01_Part2_Examples()
        {
            var d = new Day01();

            Assert.AreEqual(1, d.SolutionPart2(")"));
            Assert.AreEqual(5, d.SolutionPart2("()())"));
        }
示例#2
0
        public void Day01_Part2_Solution()
        {
            var d = new Day01();

            var input = FileHelper.ReadTestFile(1);
            Assert.IsNotNull(input);

            var expected = 1797;
            var actual = d.SolutionPart2(input);

            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void Day01_Part1_Examples()
        {
            var d = new Day01();

            Assert.AreEqual(0, d.SolutionPart1("(())"));
            Assert.AreEqual(0, d.SolutionPart1("()()"));
            Assert.AreEqual(3, d.SolutionPart1("((("));
            Assert.AreEqual(3, d.SolutionPart1("(()(()("));
            Assert.AreEqual(3, d.SolutionPart1("))((((("));
            Assert.AreEqual(-1, d.SolutionPart1("())"));
            Assert.AreEqual(-1, d.SolutionPart1("))("));
            Assert.AreEqual(-3, d.SolutionPart1(")))"));
            Assert.AreEqual(-3, d.SolutionPart1(")())())"));
        }