mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 22:11:10 +00:00
Refactors the test fixtures and their consumers to compose other fixtures instead of instantiating models inline
This commit is contained in:
1 parent
0abda472c6
commit
3aadd6de84
157 files changed
+1312
-597
No files matched your search
+5
-2
@@ -1,5 +1,6 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Plugins.OpenLibrary.Common.Models.DTO.Settings;
|
||||
using Lumina.Plugins.OpenLibrary.Fixtures.Common.Models.DTO.Settings;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
@@ -12,11 +13,13 @@ namespace Lumina.Plugins.OpenLibrary.UnitTests.Common.Models.DTO.Settings;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class OpenLibrarySettingsDtoTests
|
||||
{
|
||||
private readonly OpenLibrarySettingsDtoFixture _openLibrarySettingsDtoFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Defaults_WhenCreated_ShouldUseTheDocumentedDefaultValues()
|
||||
{
|
||||
// Arrange
|
||||
OpenLibrarySettingsDto sut = new();
|
||||
OpenLibrarySettingsDto sut = _openLibrarySettingsDtoFixture.Create(includeUserAgent: false, includeSearchResultLimit: false, includeWorkEditionLimit: false, includeMinimumRequestInterval: false);
|
||||
|
||||
// Act
|
||||
|
||||
@@ -32,7 +35,7 @@ public class OpenLibrarySettingsDtoTests
|
||||
public void Setters_WhenAssigned_ShouldExposeTheAssignedValues()
|
||||
{
|
||||
// Arrange
|
||||
OpenLibrarySettingsDto sut = new();
|
||||
OpenLibrarySettingsDto sut = _openLibrarySettingsDtoFixture.Create();
|
||||
TimeSpan expectedInterval = TimeSpan.FromSeconds(3);
|
||||
|
||||
// Act
|
||||
|
||||
+1
-1
@@ -230,7 +230,7 @@ public class OpenLibraryBookMetadataProviderTests
|
||||
public async Task GetSearchResultsAsync_WhenLookupHasNoPath_ShouldThrowArgumentNullException()
|
||||
{
|
||||
// Arrange
|
||||
BookMetadataLookupDto lookup = new(Guid.NewGuid(), null!, Isbn: "978-0-306-40615-7");
|
||||
BookMetadataLookupDto lookup = _bookMetadataLookupDtoFixture.Create(includePath: false, isbn: "978-0-306-40615-7");
|
||||
OpenLibraryBookMetadataProvider sut = CreateProvider(new StubOpenLibraryHttpMessageHandler());
|
||||
|
||||
// Act
|
||||
|
||||
Reference in new issue
Block a user