Пример #1
0
        public void ChooseRightRuleBasedUponLocation2()
        {
            var schedule = CreateTestSchedule();
            var rule1    = CreateTestRule(location2: TestLocations.CLPHMJN, text: "Correct");
            var rule2    = CreateTestRule(location2: TestLocations.CLPHMJC, text: "Wrong");

            var rules = new ViaRules();

            rules.AddRule(rule1);
            rules.AddRule(rule2);

            Assert.Equal("Correct", rules.GetViaText(schedule));
        }
Пример #2
0
        public void ChooseRightRuleBasedUponDestination()
        {
            var schedule = CreateTestSchedule();
            var rule1    = CreateTestRule(destination: TestLocations.WaterlooMain, text: "Correct");
            var rule2    = CreateTestRule(destination: TestLocations.Woking, text: "Wrong");

            var rules = new ViaRules();

            rules.AddRule(rule1);
            rules.AddRule(rule2);

            Assert.Equal("Correct", rules.GetViaText(schedule));
        }
Пример #3
0
        public void ReturnEmptyStringWhenNoRulesMatch()
        {
            var schedule = CreateTestSchedule();
            var rule1    = CreateTestRule(location1: TestLocations.Woking, text: "Wrong");
            var rule2    = CreateTestRule(destination: TestLocations.Woking, text: "Wrong");

            var rules = new ViaRules();

            rules.AddRule(rule1);
            rules.AddRule(rule2);

            Assert.Equal("", rules.GetViaText(schedule));
        }
Пример #4
0
        public void ChooseRightRuleBasedUponLocation1WhenAddedSecond()
        {
            var schedule = CreateTestSchedule();
            var rule1    = CreateTestRule(location1: TestLocations.Wimbledon, text: "Correct");
            var rule2    = CreateTestRule(location1: TestLocations.Woking, text: "Wrong");

            var rules = new ViaRules();

            rules.AddRule(rule2);
            rules.AddRule(rule1);

            Assert.Equal("Correct", rules.GetViaText(schedule));
        }
Пример #5
0
        public void ChooseRuleWithNoLocation2WhenLocation2DoesNotMatch()
        {
            var schedule = CreateTestSchedule();
            var rule1    = CreateTestRule(location2: TestLocations.CLPHMJC, text: "Wrong");
            var rule2    = CreateTestRule(text: "Correct");

            var rules = new ViaRules();

            rules.AddRule(rule1);
            rules.AddRule(rule2);

            Assert.Equal("Correct", rules.GetViaText(schedule));
        }