コード例 #1
0
ファイル: ChapterSlotsTest.cs プロジェクト: Cricle/Anf
        public void GivenValueInit_PropertyMustEqualInput()
        {
            var c    = new NullComicVisiting <object>();
            var slot = new ChapterSlots <object>(c);

            Assert.AreEqual(c, slot.Visiting);
        }
コード例 #2
0
        public void GivenPageManager_MustCreatedSlots()
        {
            var mgr  = new NullComicVisiting <object>();
            var slot = ComicChapterManagerExtensions.CreateChapterSlots(mgr);

            Assert.IsNotNull(slot);
            Assert.AreEqual(mgr, slot.Visiting);
        }
コード例 #3
0
        private NullComicVisiting <T> MakeVisiting <T>(int chapterCount)
        {
            var visit = new NullComicVisiting <T>();

            visit.Entity = new ComicEntity
            {
                Chapters = Enumerable.Range(0, chapterCount).Select(x => new ComicChapter
                {
                    TargetUrl = "http://localhost:5000/" + x,
                    Title     = x.ToString()
                }).ToArray()
            };
            return(visit);
        }
コード例 #4
0
        public async Task Init_CallGetCreate_MustReturnNotNull()
        {
            var factor = new StreamResourceFactoryCreator();
            var prov   = new NullSourceProvider();
            var addr   = "sdasafsd";
            var visit  = new NullComicVisiting <Stream>();
            var ctx    = new ResourceFactoryCreateContext <Stream>
            {
                SourceProvider = prov,
                Address        = addr,
                Visiting       = visit
            };

            Assert.AreEqual(prov, ctx.SourceProvider);
            Assert.AreEqual(addr, ctx.Address);
            Assert.AreEqual(visit, ctx.Visiting);
            Assert.AreEqual(visit.Host, ctx.ServiceProvider);
            var c = await factor.CreateAsync(ctx);

            Assert.IsNotNull(c);
            c.Dispose();
            factor.Dispose();
        }