Beispiel #1
0
        public async Task LoadChapter_IfAnyIntercept_TheMethodWasCalled()
        {
            var intercept = new NullComicVisitingInterceptor <Stream>();
            var visit     = ComicVisitingHelper.CreateResrouceVisitor();

            visit.VisitingInterceptor = intercept;
            var res = await visit.LoadAsync(ComicVisitingHelper.AnyUri.AbsoluteUri);

            var chp1 = await visit.GetChapterManagerAsync(0);

            Assert.IsTrue(intercept.IsGotChapterManagerAsync);
            Assert.IsTrue(intercept.IsLoadingChapterAsync);
            Assert.IsTrue(intercept.IsLoadedChapterAsync);
        }
Beispiel #2
0
        public async Task GivenValueInit_GetVisitPage_MustCallIntercepts()
        {
            var visit     = ComicVisitingHelper.CreateResrouceVisitor();
            var intercept = new NullComicVisitingInterceptor <Stream>();

            visit.VisitingInterceptor = intercept;
            await visit.LoadAsync(ComicVisitingHelper.AnyUri.AbsoluteUri);

            await visit.LoadChapterAsync(0);

            var mgr = new ComicChapterManager <Stream>(visit.ChapterWithPages[0], visit);
            var pg  = await mgr.GetVisitPageAsync(0);

            Assert.IsNotNull(pg);
            Assert.IsNotNull(pg.Page);
            Assert.IsNotNull(pg.Resource);


            Assert.IsTrue(intercept.IsGettingPageAsync);
            Assert.IsTrue(intercept.IsGotPageAsync);
        }