Example #1
0
        public void AppIsInvalidWithNoScores()
        {
            BaseballApp app = new BaseballApp();

            Assert.IsFalse(app.IsValid);
            Assert.AreEqual("We cannot connect to the baseball score server currently.", app.InvalidMessage);
        }
Example #2
0
        public void RemoteReferencesAreFilled()
        {
            BaseballApp app = new BaseballApp();

            app.Initialize(GetConfigurationManager());
            app.AddChild(new IOInterfaceReference());
            Assert.IsFalse(app.IsValid);
            Assert.AreEqual(1, app.References.Count());
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }