public void SimplestBrainReturnsCorrectAnswerMockked() { // SETUP Mock <IGbrainAPI> MockGoogleApi = new Mock <IGbrainAPI>(); MockGoogleApi.CallBase = true; MockGoogleApi.Setup(x => x.GetNumerOfResults(It.IsAny <string>(), It.Is <string>(s => s == "Answer True"))).Returns(100); MockGoogleApi.Setup(x => x.GetNumerOfResults(It.IsAny <string>(), It.Is <string>(s => s == "Answer Second"))).Returns(50); MockGoogleApi.Setup(x => x.GetNumerOfResults(It.IsAny <string>(), It.Is <string>(s => s == "Answer Third Score"))).Returns(20); SimpleResultsGBrain SmpBrain = new SimpleResultsGBrain(MockGoogleApi.Object); // EXERCISE IGAnswer res = SmpBrain.AnswerQuestion("Mockup Question", "Answer True", "Answer Third Score", "Answer Second"); // ASSERT Assert.Equal("Answer True", res.CorrectAnswer); }
private static void WriteAns(IGAnswer CorrectAns) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(CorrectAns.CorrectAnswer); Console.ResetColor(); }
public static void WriteCorrectAnswer(IGAnswer CorrectAns, string brainName) { Console.Write($"\nthe correct Answer for {brainName} Brain is: "); WriteAns(CorrectAns); }
public static void WriteCorrectAnswer(IGAnswer CorrectAns) { Console.Write("\nthe correct Answer is: "); WriteAns(CorrectAns); }