public void FetchAllPagesWithWrongFilter() { using IBaseOfferListController ctr = new HttpAllegroOfferListController(); OfferListControllerException ex = Assert.Throws <OfferListControllerException>(() => ctr.StartFetching(false, new OfferCategory(EOfferWebsite.Allegro, 1), new List <WebsiteCategoriesFilterSearch>() { new WebsiteCategoriesFilterSearch() { Argument = "offerTypeBuyNow", Value = "1", Id = 1, SearchNumber = 1, WebsiteCategoryId = (int)EOfferWebsite.Allegro }, new WebsiteCategoriesFilterSearch() { Argument = "price_to", Value = "500", SearchNumber = 1, Id = 2, WebsiteCategoryId = (int)EOfferWebsite.NoInfo } })); Assert.IsNotNull(ex); }
public void CheckOfferListControllerExceptionType() { OfferListControllerException ex = new OfferListControllerException("Example message", new BrowserAllegroOfferListController()); Assert.IsInstanceOf <Exception>(ex); Assert.IsInstanceOf <BrowserAllegroOfferListController>(ex.InvalidController); }
public void OpenNextPageWithoutStartFetching() { using IBaseOfferListController allegroOfferListController = new HttpAllegroOfferListController(); OfferListControllerException ex = Assert.Throws <OfferListControllerException>(() => allegroOfferListController.OpenNextPage()); Assert.That(ex, Is.Not.Null); allegroOfferListController.Dispose(); }
public void FetchFailAllegroLink() { using IBaseOfferListController ctr = new HttpAllegroOfferListController(); OfferListControllerException ex = Assert.Throws <OfferListControllerException>( () => ctr.StartFetching(false, new OfferCategory(EOfferWebsite.Allegro, "testfaillink"))); Assert.That(ex, Is.Not.Null); ctr.Dispose(); controller.Dispose(); }
public void IndexPageFailAllegroLinkNoCategoryWithPaginationLastIndex() { using IBaseOfferListController ctr = new HttpAllegroOfferListController(); Assert.Throws <OfferListControllerException>( () => ctr.StartFetching(false, new OfferCategory(EOfferWebsite.Allegro, "uzytkownik/KOLEKCJONER-PL--/oceny"))); OfferListControllerException ex = Assert.Throws <OfferListControllerException>(() => ctr.GetLastPageIndex()); Assert.That(ex, Is.Not.Null); ctr.Dispose(); controller.Dispose(); }
public void IndexPageFailAllegroLink() { using IBaseOfferListController ctr = new BrowserAllegroOfferListController(); OfferListControllerException e = Assert.Throws <OfferListControllerException>( () => ctr.StartFetching(false, new OfferCategory(EOfferWebsite.Allegro, "/testfaillink"))); OfferListControllerException ex = Assert.Throws <OfferListControllerException>(() => ctr.GetCurrentPageIndex()); Assert.That(e, Is.Not.Null); Assert.That(ex, Is.Not.Null); ctr.Dispose(); controller.Dispose(); }