Ejemplo n.º 1
0
        public async Task ResizeOverlayImageLarge_null_exception()
        {
            var overlayImage =
                new OverlayImage(_selectorStorage, new AppSettings());

            await overlayImage.ResizeOverlayImageLarge(null, null, new AppSettingsPublishProfiles());

            // > ArgumentNullException
        }
Ejemplo n.º 2
0
        public async Task ResizeOverlayImageLarge_overlay_image_missing()
        {
            var overlayImage =
                new OverlayImage(_selectorStorage, new AppSettings {
                ThumbnailTempFolder = "/"
            });

            await overlayImage.ResizeOverlayImageLarge("/test.jpg", "/out.jpg", new AppSettingsPublishProfiles
            {
                SourceMaxWidth  = 100,
                OverlayMaxWidth = 1
            });

            // > overlay image missing
        }
Ejemplo n.º 3
0
        public async Task ResizeOverlayImageLarge_Done()
        {
            var overlayImage =
                new OverlayImage(_selectorStorage, new AppSettings {
                ThumbnailTempFolder = "/"
            });

            await overlayImage.ResizeOverlayImageLarge("/test.jpg", "/out_large.jpg", new AppSettingsPublishProfiles
            {
                SourceMaxWidth  = 100,
                OverlayMaxWidth = 1,
                Path            = "/test.jpg"
            });

            Assert.IsTrue(_storage.ExistFile("/out_large.jpg"));
        }
Ejemplo n.º 4
0
        public async Task ResizeOverlayImageLarge_File_Not_Found()
        {
            var overlayImage =
                new OverlayImage(_selectorStorage, new AppSettings {
                ThumbnailTempFolder = "/"
            });

            await overlayImage.ResizeOverlayImageLarge("non-exist.jpg",
                                                       "/out.jpg", new AppSettingsPublishProfiles
            {
                SourceMaxWidth  = 100,
                OverlayMaxWidth = 1
            });

            // itemFileHash not found
        }
Ejemplo n.º 5
0
        public async Task ResizeOverlayImageLarge_Ignore_If_Exist()
        {
            var overlayImage =
                new OverlayImage(_selectorStorage, new AppSettings {
                ThumbnailTempFolder = "/"
            });

            await overlayImage.ResizeOverlayImageLarge("/test.jpg", "/test.jpg", new AppSettingsPublishProfiles
            {
                SourceMaxWidth  = 100,
                OverlayMaxWidth = 1,
                Path            = "/test.jpg"
            });

            // Should return nothing
            Assert.IsTrue(_storage.ExistFile("/test.jpg"));
        }