Beispiel #1
0
        public async Task OnPostAsync()
        {
            // if upload directory doesn't exist, create it
            _thumbnailer.CheckAndCreateDirectory(_uploadFolder);

            var thumbnailPath = await _thumbnailer.Create(200, _uploadFolder, $"{_uploadFolder}\\originals", Upload, 90L);

            _logger.LogInformation($"Successfully uploaded {Upload.FileName} to {thumbnailPath}");
        }
        public void CreateNewThumbnailDirectoryCreatesDirectorySuccessfully()
        {
            // reset and setup test
            _fixture.TearDownTestDirectory();
            _thumbnailer.CheckAndCreateDirectory(_thumbnailAndOriginalSaveFolder);

            // assert
            Assert.True(Directory.Exists(_thumbnailAndOriginalSaveFolder));

            // Cleanup the unnecessary folders
            Directory.Delete(_thumbnailAndOriginalSaveFolder);
        }
 public void Setup()
 {
     _thumbnailer.CheckAndCreateDirectory(ThumbnailFolder);
 }