Ejemplo n.º 1
0
        public void Example2()
        {
            List <string> testData = new List <string>
            {
                "class: 1-3 or 5-7",
                "row: 6-11 or 33-44",
                "seat: 13-40 or 45-50",
                "",
                "your ticket:",
                "7,1,14",
                "",
                "nearby tickets:",
                "7,3,47",
                "40,4,50",
                "55,2,20",
                "38,6,12"
            };

            TicketValidator validator = new TicketValidator();

            validator.ParseData(testData);
            validator.DecodeColumns();


            Assert.AreEqual("row", validator.GetRuleForColumn(0).Name);
            Assert.AreEqual("class", validator.GetRuleForColumn(1).Name);
            Assert.AreEqual("seat", validator.GetRuleForColumn(2).Name);
        }