public void ShouldDisconnect() { Sut.Start(); MockedClient.Setup(x => x.IsConnected).Returns(true); Sut.Dispose(); MockedClient.Verify(x => x.Disconnect(), Times.Once()); }
public void ShouldNotDisconnect() { Sut.Start(); MockedClient.Setup(x => x.IsConnected).Returns(false); Sut.Dispose(); MockedClient.Verify(x => x.Disconnect(), Times.Never()); }
public void ShouldSendMessage(String message, String expectedMessage) { ChatMessage chatMessage = ChatMessageBuilder .Create() .WithMessage(message) .WithChannel(ChannelName) .WithTwitchLibMessage(TwitchLibMessageBuilder .Create() .WithDisplayName(Players[0].Name)) .Build(); Sut.GetHelp(chatMessage); MockedClient.Verify( x => x.SpoolMessage( ChannelName, It.Is <String>(x => x.Contains(expectedMessage)), Priority.Low), Times.Once()); }