Esempio n. 1
0
        public void ShouldDisconnect()
        {
            Sut.Start();
            MockedClient.Setup(x => x.IsConnected).Returns(true);

            Sut.Dispose();

            MockedClient.Verify(x => x.Disconnect(), Times.Once());
        }
Esempio n. 2
0
        public void ShouldNotDisconnect()
        {
            Sut.Start();
            MockedClient.Setup(x => x.IsConnected).Returns(false);

            Sut.Dispose();

            MockedClient.Verify(x => x.Disconnect(), Times.Never());
        }
Esempio n. 3
0
        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());
        }