Пример #1
0
        public void TestJokeConversationSelectionBasic()
        {
            Dictionary <String, String> input = new Dictionary <string, string>
            {
                { "Command", "jokes" },
            };
            Conversation convo;
            JokesApp     app = new JokesApp();

            app.Initialize(GetConfigurationManager());
            app.TryCreateConversationFromPhrase(new Dialog(input, "Test Phrase"), out convo);
            Assert.IsTrue(convo is CashewJokesConversation || convo is OneLinerConversation);
        }
Пример #2
0
        public void TestJokeConversationSelectionLoops()
        {
            Dictionary <String, String> input = new Dictionary <string, string>
            {
                { "Command", "jokes" },
            };
            JokesApp app = new JokesApp();

            app.Initialize(GetConfigurationManager());
            List <Conversation> convos = new List <Conversation>();

            for (int i = 0; i < app.NumberOfJokes * 2; i++)
            {
                Conversation convo;
                app.TryCreateConversationFromPhrase(new Dialog(input, "Test Phrase"), out convo);
                convos.Add(convo);
            }
            foreach (JokeConversation convo in convos)
            {
                Assert.AreEqual(2, convos.Count(c => c.Equals(convo)));
            }
        }