Exemple #1
0
        public void Part2WithTestData()
        {
            var monsterMessages = new MonsterMessages(_testData2[0].Split(Environment.NewLine));
            var answer          = _testData2[1].Split(Environment.NewLine).Count(monsterMessages.IsValid);

            answer.ShouldBe(12);
        }
Exemple #2
0
        public void Part2()
        {
            var monsterMessages = new MonsterMessages(_input2[0].Split(Environment.NewLine));
            var answer          = _input2[1].Split(Environment.NewLine).Count(monsterMessages.IsValid);

            TestContext.WriteLine($"Answer = {answer}");
        }
Exemple #3
0
        public bool Part1WithTestData(string value)
        {
            var monsterMessages = new MonsterMessages(_testData1[0].Split(Environment.NewLine));

            monsterMessages.ParsedRule.ShouldBe("^a((aa|bb)(ab|ba)|(ab|ba)(aa|bb))b$");
            return(monsterMessages.IsValid(value));
        }