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); }
public void With_A_Known_Question_For_Global_Then_The_Answer_Should_Be_Returned() { var manager = new MockKnowledgeSource(); var conficiusAnswers = new Dictionary<string, string>(); conficiusAnswers.Add(SomeQuestion, SomeAnswer); manager.GlobalAnswers = conficiusAnswers; var conficius = new Conficius(manager); var answer = conficius.GiveMeAnAnswer(SomeQuestion); Assert.AreEqual(SomeAnswer, answer); }
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); }