public void ShouldDoNothing() { MockedStopSettingStrategy .Setup(x => x.ShouldStop(It.IsAny <ChatMessage>())) .Returns(false); Sut.Client_OnMessageReceived(null, new OnMessageReceivedArgs() { ChatMessage = ChatMessage }); MockedStopSettingStrategy.Verify(x => x.ShouldStop(ChatMessage), Times.Once()); MockedCommandRepository.Verify(x => x.DisableAllSettings(), Times.Never()); MockedWriter.Verify(x => x.WriteLine(It.IsAny <String>()), Times.Never()); }
public void ShouldDisableAllSettings() { MockedStopSettingStrategy .Setup(x => x.ShouldStop(It.IsAny <ChatMessage>())) .Returns(true); Sut.Client_OnMessageReceived(null, new OnMessageReceivedArgs() { ChatMessage = ChatMessage }); MockedStopSettingStrategy.Verify(x => x.ShouldStop(ChatMessage), Times.Once()); MockedCommandRepository.Verify(x => x.DisableAllSettings(), Times.Once()); MockedWriter.Verify(x => x.WriteLine("! ! ! DISABLED ALL SETTINGS ! ! !"), Times.Once()); MockedWriter.Verify(x => x.WriteLine($"Moderator {ExpectedDisplayName} said: \"{ExpectedMessage}\""), Times.Once()); }