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

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

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

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

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

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

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

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

            Assert.IsTrue(_storage.ExistFile("/out_thumb.jpg"));
        }
Exemplo n.º 5
0
        public void ResizeOverlayImageThumbnails_Ignore_If_Exist()
        {
            var overlayImage =
                new OverlayImage(_selectorStorage, new AppSettings {
                ThumbnailTempFolder = "/"
            });

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

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