public void Test_RequestItem_TvShowParseWithDetails() { var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string testData = File.ReadAllText(dir + @"\TestData\tvshow_veep_details.txt"); TVShowRequestItem item = new TVShowRequestItem("1", "veep", "6", "details"); IMetacriticData mItem = item.Parse(new UrlResponsePair("url", testData)); Assert.AreEqual(((MediaDetail)mItem).Details.Count, 4); CollectionAssert.Contains(((MediaDetail)mItem).Credits, new MediaCredit("Julia Louis-Dreyfus", "Vice President Selina Meyer")); CollectionAssert.Contains(((MediaDetail)mItem).Details, new DetailItem("Creators", "Armando Iannucci")); }
public void Test_RequestItem_TvShowParse3() { var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string testData = File.ReadAllText(dir + @"\TestData\tvshow_arrested_development_scraped.txt"); TVShowRequestItem item = new TVShowRequestItem("1", "arrested development", ""); item.UrlImagePath = new Dictionary <string, string>(); IMetacriticData mItem = item.Parse(new UrlResponsePair("url", testData)); Assert.AreEqual(((TVShow)mItem).Title, "Arrested Development"); Assert.AreEqual(((TVShow)mItem).Rating.CriticRating, 89); Assert.AreEqual(((TVShow)mItem).Rating.CriticReviewCount, 26); Assert.AreEqual(((TVShow)mItem).Rating.UserRating, 9.2f); Assert.AreEqual(((TVShow)mItem).Rating.UserReviewCount, 426); }
public void Test_RequestItem_TvShowParse2() { var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string testData = File.ReadAllText(dir + @"\TestData\tvshow_curbyourenthusiasm_7_scraped.txt"); TVShowRequestItem item = new TVShowRequestItem("1", "curb your enthusiasm", "7", ""); item.UrlImagePath = new Dictionary <string, string>(); IMetacriticData mItem = item.Parse(new UrlResponsePair("url", testData)); Assert.AreEqual(((TVShow)mItem).Title, "Curb Your Enthusiasm"); Assert.AreEqual(((TVShow)mItem).Rating.CriticRating, 81); Assert.AreEqual(((TVShow)mItem).Rating.CriticReviewCount, 18); Assert.AreEqual(((TVShow)mItem).Rating.UserRating, 8.5f); Assert.AreEqual(((TVShow)mItem).Rating.UserReviewCount, 58); }
public void Test_RequestItem_TvShowParse4() { var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string testData = File.ReadAllText(dir + @"\TestData_20171103\tv_six_feet_under_1.txt"); TVShowRequestItem item = new TVShowRequestItem("1", "six-feet-under", "", ""); item.UrlImagePath = new Dictionary <string, string>(); item.UrlImagePath.Add(@"\tv\six-feet-under", "temptv.jpg"); IMetacriticData mItem = item.Parse(new UrlResponsePair(@"\tv\six-feet-under", testData)); Assert.AreEqual(((TVShow)mItem).Title, "Six Feet Under"); Assert.AreEqual(((TVShow)mItem).Rating.CriticRating, 74); Assert.AreEqual(((TVShow)mItem).Rating.CriticReviewCount, 23); Assert.AreEqual(((TVShow)mItem).Rating.UserRating, 8.3f); Assert.AreEqual(((TVShow)mItem).Rating.UserReviewCount, 178); Assert.AreEqual(((TVShow)mItem).ImageUrl, "temptv.jpg"); }
public void Test_RequestItem_TvShowParse() { var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string testData = File.ReadAllText(dir + @"\TestData\tvshow_veep_6_scraped.txt"); TVShowRequestItem item = new TVShowRequestItem("1", "veep", "6", ""); item.UrlImagePath = new Dictionary <string, string>(); item.UrlImagePath.Add(@"\tv\veep", "temptv.jpg"); IMetacriticData mItem = item.Parse(new UrlResponsePair(@"\tv\veep", testData)); Assert.AreEqual(((TVShow)mItem).Title, "Veep"); Assert.AreEqual(((TVShow)mItem).Rating.CriticRating, 88); Assert.AreEqual(((TVShow)mItem).Rating.CriticReviewCount, 15); Assert.AreEqual(((TVShow)mItem).Rating.UserRating, 8.1f); Assert.AreEqual(((TVShow)mItem).Rating.UserReviewCount, 36); Assert.AreEqual(((TVShow)mItem).ImageUrl, "temptv.jpg"); }
public void Test_RequestItem_TvShowParse5() { var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string testData = File.ReadAllText(dir + @"\TestData_20171103\tv_the_wire_2.txt"); TVShowRequestItem item = new TVShowRequestItem("1", "the-wire", "2", ""); item.UrlImagePath = new Dictionary <string, string>(); item.UrlImagePath.Add(@"\tv\the-wire", "temptv.jpg"); IMetacriticData mItem = item.Parse(new UrlResponsePair(@"\tv\the-wire", testData)); Assert.AreEqual(((TVShow)mItem).Title, "The Wire"); Assert.AreEqual(((TVShow)mItem).Season, 2); Assert.AreEqual(((TVShow)mItem).Rating.CriticRating, 95); Assert.AreEqual(((TVShow)mItem).Rating.CriticReviewCount, 17); Assert.AreEqual(((TVShow)mItem).Rating.UserRating, 9.2f); Assert.AreEqual(((TVShow)mItem).Rating.UserReviewCount, 344); Assert.AreEqual(((TVShow)mItem).ImageUrl, "temptv.jpg"); }