public async Task RenderCopy_KeyNotFound()
        {
            var storage         = new FakeIStorage();
            var selectorStorage = new FakeSelectorStorage(storage);
            var appSettings     = new AppSettings
            {
                PublishProfiles = new Dictionary <string, List <AppSettingsPublishProfiles> >
                {
                    { "same", new List <AppSettingsPublishProfiles>
                      {
                          new AppSettingsPublishProfiles
                          {
                              ContentType     = TemplateContentType.Jpeg,
                              SourceMaxWidth  = 300,
                              OverlayMaxWidth = 380,
                              Folder          = "1000",
                              Append          = "_kl1k"
                          }
                      } }
                }
            };
            var service = new WebHtmlPublishService(new FakeIPublishPreflight(), selectorStorage, appSettings,
                                                    new FakeExifTool(storage, appSettings), new FakeIOverlayImage(selectorStorage),
                                                    new ConsoleWrapper(), new FakeIWebLogger());
            var result = await service.RenderCopy(new List <FileIndexItem>(),
                                                  "test", "test", "/");

            Assert.IsNull(result);
        }
        public async Task RenderCopy_ShouldNotCrash()
        {
            var storage         = new FakeIStorage();
            var selectorStorage = new FakeSelectorStorage(storage);
            var appSettings     = new AppSettings
            {
                PublishProfiles = new Dictionary <string, List <AppSettingsPublishProfiles> >
                {
                    { "test", new List <AppSettingsPublishProfiles>
                      {
                          new AppSettingsPublishProfiles
                          {
                              ContentType = TemplateContentType.Html,
                          },
                          new AppSettingsPublishProfiles
                          {
                              ContentType     = TemplateContentType.Jpeg,
                              SourceMaxWidth  = 300,
                              OverlayMaxWidth = 380,
                              Folder          = "1000",
                              Append          = "_kl1k"
                          },
                          new AppSettingsPublishProfiles
                          {
                              ContentType     = TemplateContentType.OnlyFirstJpeg,
                              SourceMaxWidth  = 300,
                              OverlayMaxWidth = 380,
                              Folder          = "1000",
                              Append          = "__fi_kl"
                          },
                          new AppSettingsPublishProfiles
                          {
                              ContentType = TemplateContentType.MoveSourceFiles,
                          },
                          new AppSettingsPublishProfiles
                          {
                              ContentType = TemplateContentType.PublishContent,
                          },
                          new AppSettingsPublishProfiles
                          {
                              ContentType = TemplateContentType.PublishManifest,
                          },
                      } }
                }
            };
            var service = new WebHtmlPublishService(new PublishPreflight(appSettings,
                                                                         new ConsoleWrapper()), selectorStorage, appSettings,
                                                    new FakeExifTool(storage, appSettings), new FakeIOverlayImage(selectorStorage),
                                                    new ConsoleWrapper(), new FakeIWebLogger());

            var result = await service.RenderCopy(new List <FileIndexItem>(),
                                                  "test", "test", "/");

            Assert.IsNotNull(result);
        }
        public async Task RenderCopy_NoConfigItems()
        {
            var storage         = new FakeIStorage();
            var selectorStorage = new FakeSelectorStorage(storage);
            var appSettings     = new AppSettings();
            var service         = new WebHtmlPublishService(new FakeIPublishPreflight(), selectorStorage, appSettings,
                                                            new FakeExifTool(storage, appSettings), new FakeIOverlayImage(selectorStorage),
                                                            new ConsoleWrapper(), new FakeIWebLogger());
            var result = await service.RenderCopy(new List <FileIndexItem>(),
                                                  "test", "test", "/");

            Assert.IsNull(result);
        }
        public async Task RenderCopy_OnlyFirstJpeg_ShouldNotCrash()
        {
            var storage = new FakeIStorage(new List <string> {
                "/"
            },
                                           new List <string> {
                "/test.jpg"
            },
                                           new List <byte[]> {
                CreateAnImage.Bytes
            });

            var selectorStorage = new FakeSelectorStorage(storage);
            var appSettings     = new AppSettings
            {
                PublishProfiles = new Dictionary <string, List <AppSettingsPublishProfiles> >
                {
                    { "test", new List <AppSettingsPublishProfiles>
                      {
                          new AppSettingsPublishProfiles
                          {
                              ContentType     = TemplateContentType.OnlyFirstJpeg,
                              SourceMaxWidth  = 300,
                              OverlayMaxWidth = 380,
                              Folder          = "",
                              Append          = "__fi_kl"
                          }
                      } }
                }
            };
            var overlayService = new FakeIOverlayImage(selectorStorage);
            var service        = new WebHtmlPublishService(new PublishPreflight(appSettings,
                                                                                new ConsoleWrapper()), selectorStorage, appSettings,
                                                           new FakeExifTool(storage, appSettings), overlayService,
                                                           new ConsoleWrapper(), new FakeIWebLogger());

            var result = await service.RenderCopy(new List <FileIndexItem>
            {
                new FileIndexItem("/test.jpg")
            },
                                                  "test", "test", "/");

            Assert.IsNotNull(result);
        }