public void GetCurrentChannel() { TestWrapper(async(TwitchConnection connection) => { ChannelModel channel = await ChannelsServiceUnitTests.GetCurrentChannel(connection); }); }
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); }); }
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); }); }
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); }); }
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); }); }
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); }); }