Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public void ShouldJoinChannelIfBothInitializeClientAndJoinChannels(
            Boolean successfullyInitializeClient,
            Boolean successfullyJoinChannels,
            Boolean expectedSucess)
        {
            MockedTwitchClientManager
            .Setup(x => x.TryInitializeTwitchClient(Sut, It.IsAny <IClientOptions>(), It.IsAny <LoginCredentials>()))
            .Returns(successfullyInitializeClient ? LoginCredentials : null);

            MockedTwitchClientManager
            .Setup(x => x.TryJoinInitialChannels(It.IsAny <IReadOnlyList <JoinedChannel> >()))
            .Returns(successfullyJoinChannels);

            var result = Sut.Start();

            Assert.Equal(expectedSucess ? LoginCredentials : null, result);
        }