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)); }
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)); }
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)); }
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)); }
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)); }