public void FrequencyAgentDoesntGuessLettersInClue() { IHangDictionary hangDictionary = MockRepository.GenerateStub<IHangDictionary>(); IStrategyAgent agent = new NaturalFrequencyAgent(hangDictionary); hangDictionary.Stub(s => s.Words).Return(new[] { "randem", "netice", "werdly", "banana" }); char letter = 'e'; agent.RemoveLetter(letter); Assert.False(agent.GetBestGuesses().Contains(letter)); }
public void FrequencyAgentReturnsOrderedGuesses() { IHangDictionary hangDictionary = MockRepository.GenerateStub<IHangDictionary>(); IStrategyAgent agent = new NaturalFrequencyAgent(hangDictionary); hangDictionary.Stub(s => s.Words).Return(new[] {"randem", "netice", "werdly", "banana"}); var guesses = agent.GetBestGuesses(); Assert.Equal('e',guesses[0]); Assert.Equal('t', guesses[1]); Assert.Equal('a', guesses[2]); Assert.False(guesses.Contains('o')); }