public static async Task <IChannel> GetChannelNetAsync(string channelID, SiteType site) { ChannelPOCO poco = null; try { switch (site) { case SiteType.YouTube: poco = await YouTubeSite.GetChannelFullNetAsync(channelID).ConfigureAwait(false); break; case SiteType.RuTracker: poco = await CommonFactory.CreateRutrackerSite().GetChannelNetAsync(channelID).ConfigureAwait(false); break; case SiteType.Tapochek: poco = await CommonFactory.CreateTapochekSite().GetChannelNetAsync(channelID).ConfigureAwait(false); break; } IChannel channel = CreateChannel(poco); return(channel); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task GetFullChannel() { ChannelPOCO channel = await YouTubeSite.GetChannelFullNetAsync("UCeXeMXzjt21uv5tonZHtOrA").ConfigureAwait(false); int count = await YouTubeSite.GetChannelItemsCountNetAsync("UCeXeMXzjt21uv5tonZHtOrA").ConfigureAwait(false); Assert.IsTrue(channel.Items.Count == count); Assert.IsTrue(channel.Items.Any()); Assert.IsTrue(channel.Playlists.Any()); }