mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Converts the web client request objects from classes to records.
This commit is contained in:
1 parent
5a27c22109
commit
defbd9176f
26 files changed
+247
-383
No files matched your search
+11
-12
@@ -10,7 +10,7 @@ using System.Linq;
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Libraries;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="GetBooksLiteRequest"/> class.
|
||||
/// Fixture class for the <see cref="GetBooksLiteRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GetBooksLiteRequestFixture
|
||||
@@ -37,17 +37,16 @@ public class GetBooksLiteRequestFixture
|
||||
string? sortBy = null,
|
||||
SortOrder? sortOrder = null)
|
||||
{
|
||||
return new GetBooksLiteRequest
|
||||
{
|
||||
LibraryId = libraryId ?? Guid.NewGuid(),
|
||||
CurrentPage = currentPage,
|
||||
PerPage = perPage,
|
||||
SearchTerm = searchTerm,
|
||||
FilterAlphaKey = filterAlphaKey,
|
||||
ShouldIgnoreThePrefixForAlphaPicker = shouldIgnoreThePrefixForAlphaPicker,
|
||||
SortBy = sortBy,
|
||||
SortOrder = sortOrder
|
||||
};
|
||||
return new GetBooksLiteRequest(
|
||||
LibraryId: libraryId ?? Guid.NewGuid(),
|
||||
CurrentPage: currentPage,
|
||||
PerPage: perPage,
|
||||
SearchTerm: searchTerm,
|
||||
FilterAlphaKey: filterAlphaKey,
|
||||
ShouldIgnoreThePrefixForAlphaPicker: shouldIgnoreThePrefixForAlphaPicker,
|
||||
SortBy: sortBy,
|
||||
SortOrder: sortOrder
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+22
-23
@@ -15,7 +15,7 @@ using System.Linq;
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Library.WrittenContentLibrary.BookLibrary.Books;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="UpdateBookRequest"/> class.
|
||||
/// Fixture class for the <see cref="UpdateBookRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UpdateBookRequestFixture
|
||||
@@ -73,28 +73,27 @@ public class UpdateBookRequestFixture
|
||||
bool includeContributors = true,
|
||||
bool includeRatings = true)
|
||||
{
|
||||
return new UpdateBookRequest
|
||||
{
|
||||
BookId = id?.ToString() ?? Guid.NewGuid().ToString(),
|
||||
LibraryId = libraryId ?? Guid.NewGuid(),
|
||||
Metadata = includeMetadata ? (metadata ?? _writtenContentMetadataDtoFixture.Create()) : null,
|
||||
Format = includeFormat ? _faker.PickRandom<BookFormat>() : null,
|
||||
Edition = includeEdition ? _faker.Random.String2(_faker.Random.Number(1, 50)) : null,
|
||||
VolumeNumber = includeVolumeNumber ? _faker.Random.Number(1, 3) : null,
|
||||
Series = includeSeries ? _bookSeriesDtoFixture.Create() : null,
|
||||
ASIN = includeAsin ? _faker.Random.String2(10) : null,
|
||||
GoodreadsId = includeGoodreadsId ? _faker.Random.Number(100000, 500000).ToString() : null,
|
||||
LCCN = includeLccn ? "n78890351" : null,
|
||||
OCLCNumber = includeOclcNumber ? "ocm12345678" : null,
|
||||
OpenLibraryId = includeOpenLibraryId ? "OL123456M" : null,
|
||||
LibraryThingId = includeLibraryThingId ? _faker.Random.String2(_faker.Random.Number(1, 50)) : null,
|
||||
GoogleBooksId = includeGoogleBooksId ? CreateGoogleBooksId() : null,
|
||||
BarnesAndNobleId = includeBarnesAndNobleId ? _faker.Random.String2(10, "0123456789") : null,
|
||||
AppleBooksId = includeAppleBooksId ? $"id{_faker.Random.Number(1, 999999)}" : null,
|
||||
ISBNs = includeIsbns ? [.. _isbnDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null,
|
||||
Contributors = includeContributors ? [.. _mediaContributorDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null,
|
||||
Ratings = includeRatings ? [.. _bookRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null
|
||||
};
|
||||
return new UpdateBookRequest(
|
||||
BookId: id?.ToString() ?? Guid.NewGuid().ToString(),
|
||||
LibraryId: libraryId ?? Guid.NewGuid(),
|
||||
Metadata: includeMetadata ? (metadata ?? _writtenContentMetadataDtoFixture.Create()) : null,
|
||||
Format: includeFormat ? _faker.PickRandom<BookFormat>() : null,
|
||||
Edition: includeEdition ? _faker.Random.String2(_faker.Random.Number(1, 50)) : null,
|
||||
VolumeNumber: includeVolumeNumber ? _faker.Random.Number(1, 3) : null,
|
||||
Series: includeSeries ? _bookSeriesDtoFixture.Create() : null,
|
||||
ASIN: includeAsin ? _faker.Random.String2(10) : null,
|
||||
GoodreadsId: includeGoodreadsId ? _faker.Random.Number(100000, 500000).ToString() : null,
|
||||
LCCN: includeLccn ? "n78890351" : null,
|
||||
OCLCNumber: includeOclcNumber ? "ocm12345678" : null,
|
||||
OpenLibraryId: includeOpenLibraryId ? "OL123456M" : null,
|
||||
LibraryThingId: includeLibraryThingId ? _faker.Random.String2(_faker.Random.Number(1, 50)) : null,
|
||||
GoogleBooksId: includeGoogleBooksId ? CreateGoogleBooksId() : null,
|
||||
BarnesAndNobleId: includeBarnesAndNobleId ? _faker.Random.String2(10, "0123456789") : null,
|
||||
AppleBooksId: includeAppleBooksId ? $"id{_faker.Random.Number(1, 999999)}" : null,
|
||||
ISBNs: includeIsbns ? [.. _isbnDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null,
|
||||
Contributors: includeContributors ? [.. _mediaContributorDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null,
|
||||
Ratings: includeRatings ? [.. _bookRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+5
-6
@@ -10,7 +10,7 @@ using System.Linq;
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="ReorderLibraryArtworkProvidersRequest"/> class.
|
||||
/// Fixture class for the <see cref="ReorderLibraryArtworkProvidersRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ReorderLibraryArtworkProvidersRequestFixture
|
||||
@@ -27,11 +27,10 @@ public class ReorderLibraryArtworkProvidersRequestFixture
|
||||
Guid? libraryId = null,
|
||||
List<Guid>? pluginIds = null)
|
||||
{
|
||||
return new ReorderLibraryArtworkProvidersRequest
|
||||
{
|
||||
LibraryId = libraryId ?? Guid.NewGuid(),
|
||||
PluginIds = pluginIds ?? [_faker.Random.Guid(), _faker.Random.Guid()]
|
||||
};
|
||||
return new ReorderLibraryArtworkProvidersRequest(
|
||||
LibraryId: libraryId ?? Guid.NewGuid(),
|
||||
PluginIds: pluginIds ?? [_faker.Random.Guid(), _faker.Random.Guid()]
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+5
-6
@@ -10,7 +10,7 @@ using System.Linq;
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="ReorderLibraryMetadataProvidersRequest"/> class.
|
||||
/// Fixture class for the <see cref="ReorderLibraryMetadataProvidersRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ReorderLibraryMetadataProvidersRequestFixture
|
||||
@@ -27,11 +27,10 @@ public class ReorderLibraryMetadataProvidersRequestFixture
|
||||
Guid? libraryId = null,
|
||||
List<Guid>? pluginIds = null)
|
||||
{
|
||||
return new ReorderLibraryMetadataProvidersRequest
|
||||
{
|
||||
LibraryId = libraryId ?? Guid.NewGuid(),
|
||||
PluginIds = pluginIds ?? [_faker.Random.Guid(), _faker.Random.Guid()]
|
||||
};
|
||||
return new ReorderLibraryMetadataProvidersRequest(
|
||||
LibraryId: libraryId ?? Guid.NewGuid(),
|
||||
PluginIds: pluginIds ?? [_faker.Random.Guid(), _faker.Random.Guid()]
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+6
-7
@@ -9,7 +9,7 @@ using System.Linq;
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="SetBookReaderEnabledRequest"/> class.
|
||||
/// Fixture class for the <see cref="SetBookReaderEnabledRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetBookReaderEnabledRequestFixture
|
||||
@@ -26,12 +26,11 @@ public class SetBookReaderEnabledRequestFixture
|
||||
Guid? pluginId = null,
|
||||
bool? isEnabled = null)
|
||||
{
|
||||
return new SetBookReaderEnabledRequest
|
||||
{
|
||||
LibraryId = libraryId ?? Guid.NewGuid(),
|
||||
PluginId = pluginId ?? Guid.NewGuid(),
|
||||
IsEnabled = isEnabled ?? true
|
||||
};
|
||||
return new SetBookReaderEnabledRequest(
|
||||
LibraryId: libraryId ?? Guid.NewGuid(),
|
||||
PluginId: pluginId ?? Guid.NewGuid(),
|
||||
IsEnabled: isEnabled ?? true
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+6
-7
@@ -10,7 +10,7 @@ using System.Linq;
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="SetLibraryArtworkProviderEnabledRequest"/> class.
|
||||
/// Fixture class for the <see cref="SetLibraryArtworkProviderEnabledRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetLibraryArtworkProviderEnabledRequestFixture
|
||||
@@ -29,12 +29,11 @@ public class SetLibraryArtworkProviderEnabledRequestFixture
|
||||
Guid? pluginId = null,
|
||||
bool? isEnabled = null)
|
||||
{
|
||||
return new SetLibraryArtworkProviderEnabledRequest
|
||||
{
|
||||
LibraryId = libraryId ?? Guid.NewGuid(),
|
||||
PluginId = pluginId ?? Guid.NewGuid(),
|
||||
IsEnabled = isEnabled ?? _faker.Random.Bool()
|
||||
};
|
||||
return new SetLibraryArtworkProviderEnabledRequest(
|
||||
LibraryId: libraryId ?? Guid.NewGuid(),
|
||||
PluginId: pluginId ?? Guid.NewGuid(),
|
||||
IsEnabled: isEnabled ?? _faker.Random.Bool()
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+6
-7
@@ -10,7 +10,7 @@ using System.Linq;
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="SetLibraryMetadataProviderEnabledRequest"/> class.
|
||||
/// Fixture class for the <see cref="SetLibraryMetadataProviderEnabledRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SetLibraryMetadataProviderEnabledRequestFixture
|
||||
@@ -29,12 +29,11 @@ public class SetLibraryMetadataProviderEnabledRequestFixture
|
||||
Guid? pluginId = null,
|
||||
bool? isEnabled = null)
|
||||
{
|
||||
return new SetLibraryMetadataProviderEnabledRequest
|
||||
{
|
||||
LibraryId = libraryId ?? Guid.NewGuid(),
|
||||
PluginId = pluginId ?? Guid.NewGuid(),
|
||||
IsEnabled = isEnabled ?? _faker.Random.Bool()
|
||||
};
|
||||
return new SetLibraryMetadataProviderEnabledRequest(
|
||||
LibraryId: libraryId ?? Guid.NewGuid(),
|
||||
PluginId: pluginId ?? Guid.NewGuid(),
|
||||
IsEnabled: isEnabled ?? _faker.Random.Bool()
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+5
-6
@@ -10,7 +10,7 @@ using System.Linq;
|
||||
namespace Lumina.Presentation.Web.Fixtures.Common.Requests.Plugins;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="UpdatePluginSettingsRequest"/> class.
|
||||
/// Fixture class for the <see cref="UpdatePluginSettingsRequest"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UpdatePluginSettingsRequestFixture
|
||||
@@ -27,11 +27,10 @@ public class UpdatePluginSettingsRequestFixture
|
||||
Guid? pluginId = null,
|
||||
Dictionary<string, string>? settings = null)
|
||||
{
|
||||
return new UpdatePluginSettingsRequest
|
||||
{
|
||||
PluginId = pluginId ?? Guid.NewGuid(),
|
||||
Settings = settings ?? new Dictionary<string, string> { [_faker.Lorem.Word()] = _faker.Lorem.Word() }
|
||||
};
|
||||
return new UpdatePluginSettingsRequest(
|
||||
PluginId: pluginId ?? Guid.NewGuid(),
|
||||
Settings: settings ?? new Dictionary<string, string> { [_faker.Lorem.Word()] = _faker.Lorem.Word() }
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user