Refactor constants and update CreateHistoryCommand
Updated `CreateHistoryCommand.cs` to use the `EnvelopeStatus` enum directly from the `EnvelopeGenerator.Domain.Constants` namespace. Refactored `Constants.cs` to consolidate multiple enums related to statuses, types, and roles. Modified `Fake.cs` to align with the new enum structure and introduced `Value.cs` for better organization of constant string values. Overall, these changes enhance code clarity and maintainability.
This commit is contained in:
@@ -17,6 +17,7 @@ using Microsoft.Extensions.Hosting;
|
||||
using QuestPDF.Fluent;
|
||||
using QuestPDF.Infrastructure;
|
||||
using EnvelopeGenerator.Domain;
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Tests.Application;
|
||||
|
||||
@@ -204,13 +205,13 @@ public static class Extensions
|
||||
#endregion
|
||||
|
||||
#region History
|
||||
public static CreateHistoryCommand CreateHistoryCommand<TEnvelopeQuery, TReceiverQuery>(this Faker fake, string key, Constants.EnvelopeStatus? status = null)
|
||||
public static CreateHistoryCommand CreateHistoryCommand<TEnvelopeQuery, TReceiverQuery>(this Faker fake, string key, EnvelopeStatus? status = null)
|
||||
where TEnvelopeQuery : EnvelopeQueryBase
|
||||
where TReceiverQuery : ReceiverQueryBase
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Status = status ?? fake.PickEnum<Constants.EnvelopeStatus>(),
|
||||
Status = status ?? fake.PickEnum<EnvelopeStatus>(),
|
||||
Comment = fake.Lorem.Sentence(),
|
||||
Key = key,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user