예제 #1
0
 public void GetCurrentChannel()
 {
     TestWrapper(async(TwitchConnection connection) =>
     {
         ChannelModel channel = await ChannelsServiceUnitTests.GetCurrentChannel(connection);
     });
 }
예제 #2
0
        public void DeleteAndSetChannelCommunities()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                ChannelModel channel = await ChannelsServiceUnitTests.GetCurrentChannel(connection);

                IEnumerable <CommunityModel> communities = await connection.V5API.Channels.GetChannelCommunities(channel);

                Assert.IsNotNull(communities);
                Assert.IsTrue(communities.Count() > 0);

                await connection.V5API.Channels.DeleteChannelCommunities(channel);

                IEnumerable <CommunityModel> results = await connection.V5API.Channels.GetChannelCommunities(channel);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() == 0);

                await connection.V5API.Channels.SetChannelCommunities(channel, results);

                results = await connection.V5API.Channels.GetChannelCommunities(channel);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() > 0);
            });
        }
예제 #3
0
        public void GetChannelEditors()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                ChannelModel channel = await ChannelsServiceUnitTests.GetCurrentChannel(connection);

                IEnumerable <UserModel> results = await connection.V5API.Channels.GetChannelEditors(channel);

                Assert.IsNotNull(results);
                Assert.IsTrue(results.Count() > 0);
            });
        }
예제 #4
0
        public void GetChannelByID()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                ChannelModel channel = await ChannelsServiceUnitTests.GetCurrentChannel(connection);

                ChannelModel result = await connection.V5API.Channels.GetChannelByID(channel.id);

                Assert.IsNotNull(result);
                Assert.IsNotNull(result.id);
                Assert.AreEqual(channel.id, result.id);
            });
        }
예제 #5
0
        public void GetChannelUserSubscription()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                ChannelModel channel = await ChannelsServiceUnitTests.GetCurrentChannel(connection);

                UserModel user = await connection.V5API.Users.GetCurrentUser();

                UserSubscriptionModel result = await connection.V5API.Channels.GetChannelUserSubscription(channel, user);

                Assert.IsNotNull(result);
            });
        }
예제 #6
0
        public void UpdateChannel()
        {
            TestWrapper(async(TwitchConnection connection) =>
            {
                ChannelModel channel = await ChannelsServiceUnitTests.GetCurrentChannel(connection);

                ChannelUpdateModel update = new ChannelUpdateModel()
                {
                    status = "Test Status - " + DateTimeOffset.Now.ToString()
                };

                ChannelModel result = await connection.V5API.Channels.UpdateChannel(channel, update);

                Assert.IsNotNull(result);
                Assert.IsNotNull(result.id);
                Assert.AreEqual(result.status, update.status);
            });
        }