Fix test bad practices and tighten weak assertions
- StorageServiceTests: replace out-param + manual dispose with IAsyncLifetime - PictureServiceTests: Assert.True bound checks -> Assert.InRange - CreateAlbumCommandHandlerTests: assert the specific NotFound error type instead of just IsError, matching what the test name promises - CreateAlbumRequestValidatorTests: replace a boundary Theory that computed its expected result inline with explicit Facts against the real AlbumReleaseYear constants - Remove unused using directives across a handful of production and test files found during the review Full suite verified green: 250/250 tests passing, 0 build warnings.
This commit is contained in:
@@ -27,9 +27,9 @@ public sealed class PictureServiceTests
|
||||
await using var resized = await CreateService().ResizePictureAsWebpAsync(source, 200, 200, CancellationToken.None);
|
||||
|
||||
using var result = await Image.LoadAsync(resized);
|
||||
Assert.True(result.Width <= 200);
|
||||
Assert.True(result.Height <= 200);
|
||||
Assert.True(result.Width == 200 || result.Height == 200);
|
||||
Assert.InRange(result.Width, 1, 200);
|
||||
Assert.InRange(result.Height, 1, 200);
|
||||
Assert.True(result.Width == 200 || result.Height == 200, "expected the longer side to land exactly on the target box");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user