public static async Task <IEnumerable <IVideoItem> > GetChannelItemsNetAsync(IChannel channel, int maxresult) { var lst = new List <IVideoItem>(); SiteType site = channel.Site; IEnumerable <VideoItemPOCO> res; switch (site) { case SiteType.YouTube: res = await YouTubeSite.GetChannelItemsAsync(channel.ID, maxresult).ConfigureAwait(true); break; case SiteType.Tapochek: res = await CommonFactory.CreateTapochekSite().GetChannelItemsAsync(channel, maxresult).ConfigureAwait(false); break; default: throw new Exception(EnumHelper.GetAttributeOfType(channel.Site) + " is not implemented yet"); } lst.AddRange(res.Select(poco => VideoItemFactory.CreateVideoItem(poco, site))); return(lst); }
public async Task GetChannelItemsAsync() { // UCGtFbbGApG0s_8mMuJd-zKg = berestian // UCQoZVSaWvaJN046F-8SmyPg // UCq9B1wrqZKwucNkjHnUW39A const int count = 2; IEnumerable <VideoItemPOCO> lst = await YouTubeSite.GetChannelItemsAsync("UCGtFbbGApG0s_8mMuJd-zKg", count).ConfigureAwait(false); Assert.AreEqual(count, lst.Count()); }