mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 17:11:10 +00:00
Renames project paths from Lumina to Nemera
This commit is contained in:
1 parent
ce6fddb4c9
commit
0f659a4877
6450 files changed
No files matched your search
+39
@@ -0,0 +1,39 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Contracts.Responses.UsersManagement;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Fixtures.Core.Responses.UsersManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="InitializationResponse"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class InitializationResponseFixture
|
||||
{
|
||||
private readonly Faker _faker = new();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="InitializationResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="isInitialized">Optional. Whether the application is initialized.</param>
|
||||
/// <returns>The created <see cref="InitializationResponse"/>.</returns>
|
||||
public InitializationResponse Create(
|
||||
bool? isInitialized = null)
|
||||
{
|
||||
return new InitializationResponse(isInitialized ?? _faker.Random.Bool());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="InitializationResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<InitializationResponse> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Contracts.Responses.UsersManagement.Settings;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Fixtures.Core.Responses.UsersManagement.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="PlaybackStateResponse"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PlaybackStateResponseFixture
|
||||
{
|
||||
private readonly Faker _faker = new();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="PlaybackStateResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="volume">Optional. The last volume the player reported, as a value between 0 and 1.</param>
|
||||
/// <param name="isMuted">Optional. The last mute state the player reported.</param>
|
||||
/// <returns>The created <see cref="PlaybackStateResponse"/>.</returns>
|
||||
public PlaybackStateResponse Create(
|
||||
double? volume = null,
|
||||
bool? isMuted = null)
|
||||
{
|
||||
return new PlaybackStateResponse(
|
||||
volume ?? _faker.Random.Double(0, 1),
|
||||
isMuted ?? _faker.Random.Bool());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="PlaybackStateResponse"/> instances.
|
||||
/// </summary>
|
||||
/// <param name="count">Number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<PlaybackStateResponse> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Contracts.Responses.UsersManagement.Settings;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Playback;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Fixtures.Core.Responses.UsersManagement.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="UserSettingsResponse"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UserSettingsResponseFixture
|
||||
{
|
||||
private readonly Faker _faker = new();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="UserSettingsResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="userId">Optional. The Id of the user that owns these settings.</param>
|
||||
/// <param name="isPaginationEnabled">Optional. Whether pagination is enabled for the user.</param>
|
||||
/// <param name="itemsPerPage">Optional. The number of library items displayed per page when pagination is enabled.</param>
|
||||
/// <param name="shouldIgnoreThePrefixForAlphaPicker">Optional. Whether the "The" prefix is ignored by the alpha picker.</param>
|
||||
/// <param name="isThemeCachingEnabled">Optional. Whether the theme data served to this user is cached.</param>
|
||||
/// <param name="shouldAggregateMetadataWhenMissing">Optional. Whether the metadata of the media library items is aggregated from multiple providers, when fields are missing.</param>
|
||||
/// <param name="shouldAggregateArtworkWhenMissing">Optional. Whether the artwork of the media library items is aggregated from multiple providers, when it is missing.</param>
|
||||
/// <param name="shouldRenderPdfAsImages">Optional. Whether PDF books are rendered as page images for the user.</param>
|
||||
/// <param name="shouldPreserveBookStyles">Optional. Whether the styles of the book content are preserved when it is rendered for the user.</param>
|
||||
/// <param name="shouldKeepDownloadingWhilePaused">Optional. Whether the player keeps downloading a track while playback is paused.</param>
|
||||
/// <param name="shouldAutoplay">Optional. Whether the player continues playback at the end of an album or artist.</param>
|
||||
/// <param name="isGaplessPlaybackEnabled">Optional. Whether the player transitions between consecutive tracks without a gap.</param>
|
||||
/// <param name="replayGainMode">Optional. The way ReplayGain normalization is applied to the tracks the user plays.</param>
|
||||
/// <param name="streamingQuality">Optional. The quality cap applied to the audio the server normalizes for the user.</param>
|
||||
/// <param name="vuMeterOrientation">Optional. The direction in which each channel of the VU meter of the audio player grows.</param>
|
||||
/// <param name="vuMeterSegmentCount">Optional. The number of segments each channel of the VU meter is divided into.</param>
|
||||
/// <param name="vuMeterSegmentGap">Optional. The gap, in pixels, between the segments and the channels of the VU meter.</param>
|
||||
/// <param name="vuMeterMediumThreshold">Optional. The level above which a segment of the VU meter is drawn with its medium state.</param>
|
||||
/// <param name="vuMeterHighThreshold">Optional. The level above which a segment of the VU meter is drawn with its high state.</param>
|
||||
/// <param name="vuMeterShowPeak">Optional. Whether the VU meter holds the peak level of each channel after it falls.</param>
|
||||
/// <param name="vuMeterPeakHoldDurationInMilliseconds">Optional. The time a peak of the VU meter is held before it starts falling.</param>
|
||||
/// <param name="vuMeterReleasePerSecond">Optional. The number of level units the display of the VU meter falls per second when the input level drops.</param>
|
||||
/// <param name="vuMeterPeakReleasePerSecond">Optional. The number of level units the peak of the VU meter falls per second after its hold time elapsed.</param>
|
||||
/// <returns>The created <see cref="UserSettingsResponse"/>.</returns>
|
||||
public UserSettingsResponse Create(
|
||||
Guid? userId = null,
|
||||
bool? isPaginationEnabled = null,
|
||||
int? itemsPerPage = null,
|
||||
bool? shouldIgnoreThePrefixForAlphaPicker = null,
|
||||
bool? isThemeCachingEnabled = null,
|
||||
bool? shouldAggregateMetadataWhenMissing = null,
|
||||
bool? shouldAggregateArtworkWhenMissing = null,
|
||||
bool? shouldRenderPdfAsImages = null,
|
||||
bool? shouldPreserveBookStyles = null,
|
||||
bool? shouldKeepDownloadingWhilePaused = null,
|
||||
bool? shouldAutoplay = null,
|
||||
bool? isGaplessPlaybackEnabled = null,
|
||||
ReplayGainMode? replayGainMode = null,
|
||||
PlaybackStreamingQuality? streamingQuality = null,
|
||||
VuMeterOrientation? vuMeterOrientation = null,
|
||||
int? vuMeterSegmentCount = null,
|
||||
int? vuMeterSegmentGap = null,
|
||||
double? vuMeterMediumThreshold = null,
|
||||
double? vuMeterHighThreshold = null,
|
||||
bool? vuMeterShowPeak = null,
|
||||
int? vuMeterPeakHoldDurationInMilliseconds = null,
|
||||
double? vuMeterReleasePerSecond = null,
|
||||
double? vuMeterPeakReleasePerSecond = null)
|
||||
{
|
||||
// The high threshold is generated from the medium one, so a randomized response always describes a valid meter.
|
||||
double mediumThreshold = vuMeterMediumThreshold ?? _faker.Random.Double(0, 1);
|
||||
double highThreshold = vuMeterHighThreshold ?? _faker.Random.Double(mediumThreshold, 1);
|
||||
return new UserSettingsResponse(
|
||||
userId ?? Guid.NewGuid(),
|
||||
isPaginationEnabled ?? _faker.Random.Bool(),
|
||||
itemsPerPage ?? _faker.Random.Int(1, 100),
|
||||
shouldIgnoreThePrefixForAlphaPicker ?? _faker.Random.Bool(),
|
||||
isThemeCachingEnabled ?? _faker.Random.Bool(),
|
||||
shouldAggregateMetadataWhenMissing ?? _faker.Random.Bool(),
|
||||
shouldAggregateArtworkWhenMissing ?? _faker.Random.Bool(),
|
||||
shouldRenderPdfAsImages ?? _faker.Random.Bool(),
|
||||
shouldPreserveBookStyles ?? _faker.Random.Bool(),
|
||||
shouldKeepDownloadingWhilePaused ?? _faker.Random.Bool(),
|
||||
shouldAutoplay ?? _faker.Random.Bool(),
|
||||
isGaplessPlaybackEnabled ?? _faker.Random.Bool(),
|
||||
replayGainMode ?? _faker.PickRandom<ReplayGainMode>(),
|
||||
streamingQuality ?? _faker.PickRandom<PlaybackStreamingQuality>(),
|
||||
vuMeterOrientation ?? _faker.PickRandom<VuMeterOrientation>(),
|
||||
vuMeterSegmentCount ?? _faker.Random.Int(1, 128),
|
||||
vuMeterSegmentGap ?? _faker.Random.Int(0, 32),
|
||||
mediumThreshold,
|
||||
highThreshold,
|
||||
vuMeterShowPeak ?? _faker.Random.Bool(),
|
||||
vuMeterPeakHoldDurationInMilliseconds ?? _faker.Random.Int(0, 10000),
|
||||
vuMeterReleasePerSecond ?? _faker.Random.Double(0, 100),
|
||||
vuMeterPeakReleasePerSecond ?? _faker.Random.Double(0, 100));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="UserSettingsResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<UserSettingsResponse> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Contracts.Responses.UsersManagement.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Fixtures.Core.Responses.UsersManagement.Users;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="UserResponse"/> record.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class UserResponseFixture
|
||||
{
|
||||
private readonly Faker _faker = new();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="UserResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="id">Optional. The Id of the user.</param>
|
||||
/// <param name="username">Optional. The username of the user.</param>
|
||||
/// <param name="createdOnUtc">Optional. The date and time when the user was created.</param>
|
||||
/// <param name="updatedOnUtc">Optional. The date and time when the user was updated.</param>
|
||||
/// <returns>The created <see cref="UserResponse"/>.</returns>
|
||||
public UserResponse Create(
|
||||
Guid? id = null,
|
||||
string? username = null,
|
||||
DateTime? createdOnUtc = null,
|
||||
DateTime? updatedOnUtc = null)
|
||||
{
|
||||
return new UserResponse(
|
||||
id ?? Guid.NewGuid(),
|
||||
username ?? _faker.Internet.UserName(),
|
||||
createdOnUtc ?? _faker.Date.Past().ToUniversalTime(),
|
||||
updatedOnUtc
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="UserResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of elements to create.</param>
|
||||
/// <returns>The created list.</returns>
|
||||
public List<UserResponse> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user