From ef1b66875ce00e1a815228c5e087fb7a9f2209d1 Mon Sep 17 00:00:00 2001 From: Dion Date: Wed, 11 Sep 2024 16:21:15 +0200 Subject: [PATCH] format/fix --- .../ThumbnailQueuedHostedServiceTest.cs | 13 ++++++++++--- .../Services/ExifToolHostStorageServiceTest.cs | 13 +++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/starsky/starskytest/starsky.foundation.worker/ThumbnailServices/ThumbnailQueuedHostedServiceTest.cs b/starsky/starskytest/starsky.foundation.worker/ThumbnailServices/ThumbnailQueuedHostedServiceTest.cs index 6cda71f773..fde7a0f84e 100644 --- a/starsky/starskytest/starsky.foundation.worker/ThumbnailServices/ThumbnailQueuedHostedServiceTest.cs +++ b/starsky/starskytest/starsky.foundation.worker/ThumbnailServices/ThumbnailQueuedHostedServiceTest.cs @@ -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? func = null; - // ReSharper disable once ExpressionIsAlwaysNull - await _bgTaskQueue.QueueBackgroundWorkItemAsync(func!, string.Empty); + + // Act & Assert + await Assert.ThrowsExceptionAsync(async () => + { + // ReSharper disable once ExpressionIsAlwaysNull + await _bgTaskQueue.QueueBackgroundWorkItemAsync(func!, string.Empty); + }); + + // Additional verification Assert.IsNull(func); } diff --git a/starsky/starskytest/starsky.foundation.writemeta/Services/ExifToolHostStorageServiceTest.cs b/starsky/starskytest/starsky.foundation.writemeta/Services/ExifToolHostStorageServiceTest.cs index a382280b88..e5cc56ca97 100644 --- a/starsky/starskytest/starsky.foundation.writemeta/Services/ExifToolHostStorageServiceTest.cs +++ b/starsky/starskytest/starsky.foundation.writemeta/Services/ExifToolHostStorageServiceTest.cs @@ -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 { "/" }, new List { "/test.jpg" }, @@ -41,13 +41,13 @@ public async Task ExifToolHostStorageService_NotFound_Exception() } /// - /// WriteTagsAndRenameThumbnailAsyncTest + /// WriteTagsAndRenameThumbnailAsyncTest /// [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 { "/" }, new List { "/test.jpg" }, @@ -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-")))? @@ -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 { "/" }, @@ -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 { "/" }, new List { "/test.jpg" },