public void AppIsInvalidWithNoScores() { BaseballApp app = new BaseballApp(); Assert.IsFalse(app.IsValid); Assert.AreEqual("We cannot connect to the baseball score server currently.", app.InvalidMessage); }
public void RemoteReferencesAreFilled() { BaseballApp app = new BaseballApp(); app.Initialize(GetConfigurationManager()); app.AddChild(new IOInterfaceReference()); Assert.IsFalse(app.IsValid); Assert.AreEqual(1, app.References.Count()); }
public void AppIsValidWithScores() { Mock <IBaseballSensor> sensor = new Mock <IBaseballSensor>(); AddComponentToConfigurationManager(sensor.Object); BaseballApp app = new BaseballApp(); app.Initialize(GetConfigurationManager()); Assert.IsTrue(app.IsValid); Assert.AreEqual(String.Empty, app.InvalidMessage); }
public void WhatsTheScoreMascotName() { Dictionary <String, String> expectedParams = new Dictionary <string, string> { { "Command", "baseball" }, { "Parameter", "Score" }, { "Time", "DayOfWeek=today;" }, { "Team", "mockteam" }, }; Mock <IBaseballSensor> sensor = new Mock <IBaseballSensor>(MockBehavior.Strict); sensor.Setup(s => s.IsValid).Returns(true); sensor.Setup(s => s.Teams).Returns(_mockTeams); AddComponentToConfigurationManager(sensor.Object); BaseballApp app = new BaseballApp(); TestGrammar(app, GetConfigurationManager(), "What's the score of the Mockers game", expectedParams); }
public void FreeMLBTVGame() { Dictionary <String, String> expectedParams = new Dictionary <string, string> { { "Command", "baseball" }, { "Parameter", "MLBTVFreeGame" }, { "Time", "DayOfWeek=today;" }, { "Team", "" }, }; Mock <IBaseballSensor> sensor = new Mock <IBaseballSensor>(MockBehavior.Strict); sensor.Setup(s => s.IsValid).Returns(true); sensor.Setup(s => s.Teams).Returns(_mockTeams); AddComponentToConfigurationManager(sensor.Object); BaseballApp app = new BaseballApp(); TestGrammar(app, GetConfigurationManager(), "What game is free tonight on MLB.TV", expectedParams); }
public void HowFarBackIsTheTeamFullName() { Dictionary <String, String> expectedParams = new Dictionary <string, string> { { "Command", "baseball" }, { "Parameter", "Standings" }, { "Time", "DayOfWeek=today;" }, { "Team", "mockteam" }, }; Mock <IBaseballSensor> sensor = new Mock <IBaseballSensor>(MockBehavior.Strict); sensor.Setup(s => s.IsValid).Returns(true); sensor.Setup(s => s.Teams).Returns(_mockTeams); AddComponentToConfigurationManager(sensor.Object); BaseballApp app = new BaseballApp(); TestGrammar(app, GetConfigurationManager(), "How far back are the Mock City Mockers", expectedParams); }