Skip to content

Commit

Permalink
format/fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Sep 11, 2024
1 parent ab93cfc commit ef1b668
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,20 @@ public async Task ThumbnailQueuedHostedServiceTest_Verify_Hosted_Service_Execute
await service.StopAsync(CancellationToken.None);
}

[ExpectedException(typeof(ArgumentNullException))]
[TestMethod]
public async Task ThumbnailQueuedHostedServiceTest_ArgumentNullExceptionFail()
{
// Arrange
Func<CancellationToken, ValueTask>? func = null;
// ReSharper disable once ExpressionIsAlwaysNull
await _bgTaskQueue.QueueBackgroundWorkItemAsync(func!, string.Empty);

// Act & Assert
await Assert.ThrowsExceptionAsync<ArgumentNullException>(async () =>
{
// ReSharper disable once ExpressionIsAlwaysNull
await _bgTaskQueue.QueueBackgroundWorkItemAsync(func!, string.Empty);
});

// Additional verification
Assert.IsNull(func);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public ExifToolHostStorageServiceTest()
[ExpectedException(typeof(ArgumentException))]
public async Task ExifToolHostStorageService_NotFound_Exception()
{
var appSettings = new AppSettings { ExifToolPath = "Z://Non-exist", };
var appSettings = new AppSettings { ExifToolPath = "Z://Non-exist" };

var fakeStorage = new FakeIStorage(new List<string> { "/" },
new List<string> { "/test.jpg" },
Expand All @@ -41,13 +41,13 @@ public async Task ExifToolHostStorageService_NotFound_Exception()
}

/// <summary>
/// WriteTagsAndRenameThumbnailAsyncTest
/// WriteTagsAndRenameThumbnailAsyncTest
/// </summary>
[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public async Task WriteTagsAndRenameThumbnailAsync_NotFound_Exception()
{
var appSettings = new AppSettings { ExifToolPath = "Z://Non-exist", };
var appSettings = new AppSettings { ExifToolPath = "Z://Non-exist" };

var fakeStorage = new FakeIStorage(new List<string> { "/" },
new List<string> { "/test.jpg" },
Expand Down Expand Up @@ -77,7 +77,8 @@ public async Task WriteTagsAndRenameThumbnailAsync_FakeExifToolBashTest_UnixOnly
hostFileSystemStorage.FolderDelete(outputPath);
}

await new TarBal(hostFileSystemStorage, new FakeIWebLogger()).ExtractTarGz(memoryStream, outputPath,
await new TarBal(hostFileSystemStorage, new FakeIWebLogger()).ExtractTarGz(memoryStream,
outputPath,
CancellationToken.None);
var imageExifToolVersionFolder = hostFileSystemStorage.GetDirectories(outputPath)
.FirstOrDefault(p => p.StartsWith(Path.Combine(outputPath, "Image-ExifTool-")))?
Expand All @@ -93,7 +94,7 @@ await Command.Run("chmod", "+x",

var appSettings = new AppSettings
{
ExifToolPath = Path.Combine(imageExifToolVersionFolder, "exiftool"),
ExifToolPath = Path.Combine(imageExifToolVersionFolder, "exiftool")
};

var fakeStorage = new FakeIStorage(new List<string> { "/" },
Expand Down Expand Up @@ -185,7 +186,7 @@ await hostFileSystemStorage.WriteStreamAsync(new MemoryStream(item),
[ExpectedException(typeof(ArgumentException))]
public async Task ExifToolHostStorageService_WriteTagsThumbnailAsync_NotFound_Exception()
{
var appSettings = new AppSettings { ExifToolPath = "Z://Non-exist", };
var appSettings = new AppSettings { ExifToolPath = "Z://Non-exist" };

var fakeStorage = new FakeIStorage(new List<string> { "/" },
new List<string> { "/test.jpg" },
Expand Down

0 comments on commit ef1b668

Please sign in to comment.