public void ShouldDoNothing(String command) { Sut.ReadCommand(command); Assert.Equal(BotState.ShouldContinue, Sut.State); MockedCommandRepository.Verify(x => x.Execute(It.IsAny <Name>(), It.IsAny <IEnumerable <String> >()), Times.Never()); }
public void ShouldDisableAllSettingsWithNoArguments() { Sut.Execute(Array.Empty <String>()); MockedCommandRepository.Verify(x => x.DisableAllSettings(), Times.Once()); MockedWriter.Verify(x => x.WriteLine("Disabled all settings."), Times.Once()); }
public void ShouldDisableAllSettings(params String[] arguments) { Sut.Execute(arguments); MockedCommandRepository.Verify(x => x.DisableAllSettings(), Times.Once()); MockedWriter.Verify(x => x.WriteLine("Disabled all settings."), Times.Once()); }
public void ShouldExecuteCommand(String command) { Sut.ReadCommand(command); Assert.Equal(BotState.ShouldContinue, Sut.State); MockedCommandRepository.Verify(x => x .Execute( Name.From("a"), It.Is <IEnumerable <String> >(args => !args.Any(String.IsNullOrWhiteSpace))), Times.Once); }
public void ShouldContainRelevantInformation(Boolean isModerator, String expectedModeratorText) { Sut.IsModerator = isModerator; var commandStatus = Guid.NewGuid().ToString(); MockedCommandRepository.Setup(x => x.GetStatus()).Returns(commandStatus); MockedTwitchClientManager.Setup(x => x.PrimaryChannelName).Returns(Guid.NewGuid().ToString()); String prompt = Sut.GetPrompt(); Assert.Contains(commandStatus, prompt); Assert.Contains(expectedModeratorText, prompt); Assert.Contains(MockedTwitchClientManager.Object.PrimaryChannelName, prompt); }
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()); }
public void ShouldDisableAllSettingsWithGarbageArguments() { Sut.Execute(new String[] { "asdf", "38f9f" }); MockedCommandRepository.Verify(x => x.DisableAllSettings(), Times.Once()); }