Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public void CheckOfferListControllerExceptionType()
        {
            OfferListControllerException ex = new OfferListControllerException("Example message", new BrowserAllegroOfferListController());

            Assert.IsInstanceOf <Exception>(ex);
            Assert.IsInstanceOf <BrowserAllegroOfferListController>(ex.InvalidController);
        }
Ejemplo n.º 3
0
        public void OpenNextPageWithoutStartFetching()
        {
            using IBaseOfferListController allegroOfferListController = new HttpAllegroOfferListController();
            OfferListControllerException ex =
                Assert.Throws <OfferListControllerException>(() => allegroOfferListController.OpenNextPage());

            Assert.That(ex, Is.Not.Null);
            allegroOfferListController.Dispose();
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
0
        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();
        }