Ejemplo n.º 1
0
        public void Without_Any_Answer_For_Local_Conficius_Returns_Null()
        {
            var manager = new MockKnowledgeSource();
            manager.LocalAnswers = new Dictionary<string, string>();

            var conficius = new Conficius(manager);

            var answer = conficius.GiveMeAnInternalAnswer(SomeQuestion);
            Assert.IsNull(answer);
        }
Ejemplo n.º 2
0
        public void With_A_Known_Question_For_Global_And_Local_When_Asking_For_Only_Internal_Then_The_Answer_Should_Be_Returned_From_Internal()
        {
            var manager = new MockKnowledgeSource();
            var globalAnswers = new Dictionary<string, string>();
            globalAnswers.Add(SomeQuestion, SomeAnswer);
            var localAnswers = new Dictionary<string, string>();
            localAnswers.Add(SomeQuestion, AnotherAnswer);

            manager.GlobalAnswers = globalAnswers;
            manager.LocalAnswers = localAnswers;
            var conficius = new Conficius(manager);

            var answer = conficius.GiveMeAnInternalAnswer(SomeQuestion);
            Assert.AreEqual(AnotherAnswer, answer);
        }