public void CreateFeedEntryTest() { CommentsFeed target = new CommentsFeed(null, null); CommentEntry actual = target.CreateFeedEntry() as CommentEntry; Assert.IsNotNull(actual, "That feed better creates a CommentEntry."); }
public void CommentsFeedConstructorTest() { CommentsFeed target = new CommentsFeed(null, null); Assert.IsNotNull(target, "better have an object"); Assert.IsNull(target.Service, "better have no service yet"); }
public static async Task <List <Comments> > getComments(string videoId) { string content = await MakeWebRequestAsync(string.Format("https://gdata.youtube.com/feeds/api/videos/{0}/comments?alt=json&v=2", videoId)); CommentsFeed feed = JsonConvert.DeserializeObject <CommentsFeed>(content); List <Comments> comments = new List <Comments>(); foreach (CommentsEntry e in feed.feed.entry) { Comments c = new Comments(); c.author = e.author[0].name.t; var x = await getUserDetails(e.author[0].ytuserId.t); c.UserPicture = new BitmapImage(new System.Uri(x.entry.mediathumbnail.url)); c.content = e.content.t; comments.Add(c); } return(comments); }