Beispiel #1
0
        public async Task GetImagesSrcRangeAsyncIsNotSameCategoryTest()
        {
            //arange
            DeviantManager dm            = new DeviantManager(new StubDeviantArtRepository());
            var            expectedCount = 3;

            //act
            var c = await dm.GetImagesSrcRangeAsync(true, new CategoryItem()
            {
                ImageCategory = ImageCatogory.hot
            });

            c = await dm.GetImagesSrcRangeAsync(true, new CategoryItem()
            {
                ImageCategory = ImageCatogory.hot
            });

            c = await dm.GetImagesSrcRangeAsync(false, new CategoryItem()
            {
                ImageCategory = ImageCatogory.hot
            });

            //asert
            Assert.IsTrue(expectedCount == c.ToList().Count());
        }
Beispiel #2
0
        public void GetImagesCategoriesTest()
        {
            //arange
            DeviantManager dm            = new DeviantManager(new StubDeviantArtRepository());
            var            expectedCount = 10;

            //act
            var c = dm.GetImagesCategories();

            //asert
            Assert.IsTrue(expectedCount == c.Count());
        }
Beispiel #3
0
        public async Task GetImageSourceToDownloadAsyncTest()
        {
            //arange
            DeviantManager dm          = new DeviantManager(new StubDeviantArtRepository());
            var            expectedSrc = "Src";

            //act
            var currentSrc = await dm.GetImageSourceToDownloadAsync("FakeId");

            //asert
            Assert.IsTrue(expectedSrc == currentSrc);
        }
Beispiel #4
0
        public async Task GetImagesSrcRangeAsyncTest()
        {
            //arange
            DeviantManager dm = new DeviantManager(new StubDeviantArtRepository());
            bool           expectedIsDownloadable = false;

            //act
            var c = await dm.GetImagesSrcRangeAsync(0, new CategoryItem()
            {
                ImageCategory = ImageCatogory.hot
            });

            var currentIsDownloadable = c.ToList()[1].IsDownloadable;

            //asert
            Assert.IsTrue(expectedIsDownloadable == currentIsDownloadable);
        }