mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15: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
+57
@@ -0,0 +1,57 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Contracts.Responses.Scheduling;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Fixtures.Core.Responses.Scheduling;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="ScheduledJobExecutionResponse"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ScheduledJobExecutionResponseFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="ScheduledJobExecutionResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="id">Optional. The Id of the execution.</param>
|
||||
/// <param name="scheduledJobId">Optional. The Id of the scheduled job whose task was executed.</param>
|
||||
/// <param name="taskType">Optional. The type of the task that was executed.</param>
|
||||
/// <param name="isCycleRun">Optional. Whether the execution was a cycle run.</param>
|
||||
/// <param name="startedOnUtc">Optional. The start time of the execution.</param>
|
||||
/// <param name="completedOnUtc">Optional. The completion time of the execution.</param>
|
||||
/// <returns>The created <see cref="ScheduledJobExecutionResponse"/>.</returns>
|
||||
public ScheduledJobExecutionResponse Create(
|
||||
Guid? id = null,
|
||||
Guid? scheduledJobId = null,
|
||||
ScheduledTaskType? taskType = null,
|
||||
bool? isCycleRun = null,
|
||||
DateTime? startedOnUtc = null,
|
||||
DateTime? completedOnUtc = null)
|
||||
{
|
||||
return new Faker<ScheduledJobExecutionResponse>()
|
||||
.CustomInstantiator(f => new ScheduledJobExecutionResponse(
|
||||
id ?? Guid.NewGuid(),
|
||||
scheduledJobId ?? Guid.NewGuid(),
|
||||
taskType ?? f.PickRandom<ScheduledTaskType>(),
|
||||
isCycleRun ?? f.Random.Bool(),
|
||||
startedOnUtc ?? DateTime.UtcNow,
|
||||
completedOnUtc))
|
||||
.Generate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="ScheduledJobExecutionResponse"/> instances with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="count">Number of instances to create.</param>
|
||||
/// <returns>List of configured <see cref="ScheduledJobExecutionResponse"/> instances.</returns>
|
||||
public List<ScheduledJobExecutionResponse> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Contracts.Responses.Scheduling;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Fixtures.Core.Responses.Scheduling;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="ScheduledJobResponse"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ScheduledJobResponseFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="ScheduledJobResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="id">Optional. The Id of the scheduled job.</param>
|
||||
/// <param name="name">Optional. The name of the scheduled job.</param>
|
||||
/// <param name="taskType">Optional. The type of the task executed by the scheduled job.</param>
|
||||
/// <param name="scheduleType">Optional. The type of the schedule of the scheduled job.</param>
|
||||
/// <param name="intervalMinutes">Optional. The interval in minutes of the schedule.</param>
|
||||
/// <param name="hour">Optional. The hour of the schedule.</param>
|
||||
/// <param name="minute">Optional. The minute of the schedule.</param>
|
||||
/// <param name="status">Optional. The status of the scheduled job.</param>
|
||||
/// <param name="lastStartedOnUtc">Optional. The last start time of the scheduled job.</param>
|
||||
/// <param name="lastCompletedOnUtc">Optional. The last completion time of the scheduled job.</param>
|
||||
/// <returns>The created <see cref="ScheduledJobResponse"/>.</returns>
|
||||
public ScheduledJobResponse Create(
|
||||
Guid? id = null,
|
||||
string? name = null,
|
||||
ScheduledTaskType? taskType = null,
|
||||
ScheduleType? scheduleType = null,
|
||||
int? intervalMinutes = null,
|
||||
int? hour = null,
|
||||
int? minute = null,
|
||||
ScheduledJobStatus? status = null,
|
||||
DateTime? lastStartedOnUtc = null,
|
||||
DateTime? lastCompletedOnUtc = null)
|
||||
{
|
||||
return new Faker<ScheduledJobResponse>()
|
||||
.CustomInstantiator(f =>
|
||||
{
|
||||
ScheduleType resolvedScheduleType = scheduleType ?? f.PickRandom<ScheduleType>();
|
||||
if (resolvedScheduleType == ScheduleType.WithIntervalInMinutes)
|
||||
{
|
||||
return new ScheduledJobResponse(
|
||||
id ?? Guid.NewGuid(),
|
||||
name ?? f.Commerce.ProductName(),
|
||||
taskType ?? f.PickRandom<ScheduledTaskType>(),
|
||||
resolvedScheduleType,
|
||||
intervalMinutes ?? f.Random.Int(1, 1440),
|
||||
null,
|
||||
null,
|
||||
status ?? f.PickRandom<ScheduledJobStatus>(),
|
||||
lastStartedOnUtc,
|
||||
lastCompletedOnUtc);
|
||||
}
|
||||
return new ScheduledJobResponse(
|
||||
id ?? Guid.NewGuid(),
|
||||
name ?? f.Commerce.ProductName(),
|
||||
taskType ?? f.PickRandom<ScheduledTaskType>(),
|
||||
resolvedScheduleType,
|
||||
null,
|
||||
hour ?? f.Random.Int(0, 23),
|
||||
minute ?? f.Random.Int(0, 59),
|
||||
status ?? f.PickRandom<ScheduledJobStatus>(),
|
||||
lastStartedOnUtc,
|
||||
lastCompletedOnUtc);
|
||||
})
|
||||
.Generate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="ScheduledJobResponse"/> instances with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="count">Number of instances to create.</param>
|
||||
/// <returns>List of configured <see cref="ScheduledJobResponse"/> instances.</returns>
|
||||
public List<ScheduledJobResponse> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Bogus;
|
||||
using Lumina.Contracts.Responses.Scheduling;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Contracts.Fixtures.Core.Responses.Scheduling;
|
||||
|
||||
/// <summary>
|
||||
/// Fixture class for the <see cref="SchedulerDisplayPreferencesResponse"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class SchedulerDisplayPreferencesResponseFixture
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a random valid <see cref="SchedulerDisplayPreferencesResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="userId">Optional. The Id of the user that owns the display preferences.</param>
|
||||
/// <param name="jobTypeFilter">Optional. The type of the scheduled job tasks whose executions are shown.</param>
|
||||
/// <param name="displayTimeSpan">Optional. The displayed time span.</param>
|
||||
/// <param name="displayTimeUnit">Optional. The unit of the displayed time span.</param>
|
||||
/// <returns>The created <see cref="SchedulerDisplayPreferencesResponse"/>.</returns>
|
||||
public SchedulerDisplayPreferencesResponse Create(
|
||||
Guid? userId = null,
|
||||
ScheduledTaskType? jobTypeFilter = null,
|
||||
int? displayTimeSpan = null,
|
||||
SchedulerDisplayTimeUnit? displayTimeUnit = null)
|
||||
{
|
||||
return new Faker<SchedulerDisplayPreferencesResponse>()
|
||||
.CustomInstantiator(f => new SchedulerDisplayPreferencesResponse(
|
||||
userId ?? Guid.NewGuid(),
|
||||
jobTypeFilter ?? (f.Random.Bool() ? f.PickRandom<ScheduledTaskType>() : null),
|
||||
displayTimeSpan ?? f.Random.Int(1, 24 * 60),
|
||||
displayTimeUnit ?? f.PickRandom<SchedulerDisplayTimeUnit>()))
|
||||
.Generate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a list of <see cref="SchedulerDisplayPreferencesResponse"/> instances with randomized test data.
|
||||
/// </summary>
|
||||
/// <param name="count">Number of instances to create.</param>
|
||||
/// <returns>List of configured <see cref="SchedulerDisplayPreferencesResponse"/> instances.</returns>
|
||||
public List<SchedulerDisplayPreferencesResponse> CreateMany(int count = 3)
|
||||
{
|
||||
return [.. Enumerable.Range(0, count).Select(_ => Create())];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user