Exemplo n.º 1
0
        public async Task IsUserLive_LiveUser_ReturnsTrue()
        {
            const int userId = 1;

            var twitchClient = new TwitchClientFake
            {
                IsStreamLiveReturnValue = true
            };

            using (TwitchIntegration twitchIntegration = new TwitchIntegration(new FakeBrothershipUnitOfWork(), twitchClient))
            {
                bool isUserLive = await twitchIntegration.IsUserLive(userId);

                Assert.IsTrue(isUserLive);
            }
        }
        public async Task IsUserLive_NotLiveUser_ReturnsFalse()
        {
            const int userId = 1;

            var twitchClient = new TwitchClientFake
            {
                IsStreamLiveReturnValue = false
            };

            using (TwitchIntegration twitchIntegration = new TwitchIntegration(new BrothershipUnitOfWork(DataContextCreator.CreateTestContext()),
                                                                               twitchClient))
            {
                bool isUserLive = await twitchIntegration.IsUserLive(userId);

                Assert.IsFalse(isUserLive);
            }
        }