public void CommunicateWin_WritesVictoryMessageFromResources(string victoryMessage) { _resourcesMock.Setup(resources => resources.VictoryMessage) .Returns(victoryMessage); int amountOfVictoryeMessagesWritten = 0; _consoleMock.Setup(console => console.WriteLine(It.Is <string>(line => line == victoryMessage))) .Callback(() => amountOfVictoryeMessagesWritten += 1); _communicator.CommunicateWin(); Assert.AreEqual(1, amountOfVictoryeMessagesWritten); }