refactor(Fake): update CreateReceiverCommand to be able to add email address

This commit is contained in:
2025-09-12 14:19:57 +02:00
parent 27a2d5ecc4
commit 86780477fe
3 changed files with 9 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
namespace EnvelopeGenerator.Tests.Application;
public class DocSignedNotificationTest
public class DocSignedNotificationTests
{
[SetUp]
public void Setup()

View File

@@ -50,4 +50,8 @@
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="DocSignedNotification\" />
</ItemGroup>
</Project>

View File

@@ -7,6 +7,8 @@ using EnvelopeGenerator.Application.Envelopes.Commands;
using EnvelopeGenerator.Application.Histories.Commands;
using EnvelopeGenerator.Application.Receivers.Commands;
using EnvelopeGenerator.Application.Users.Commands;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure;
using MediatR;
using Microsoft.EntityFrameworkCore;
@@ -15,8 +17,6 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using QuestPDF.Fluent;
using QuestPDF.Infrastructure;
using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Tests.Application;
@@ -139,9 +139,9 @@ public static class Extensions
}
#region Receiver Command
public static CreateReceiverCommand CreateReceiverCommand(this Faker fake) => new()
public static CreateReceiverCommand CreateReceiverCommand(this Faker fake, string? emailAddress = null) => new()
{
EmailAddress = fake.Internet.Email(),
EmailAddress = emailAddress ?? fake.Internet.Email(),
};
public static List<CreateReceiverCommand> CreateReceiverCommands(this Faker fake, int minCount = 10, int maxCount = 20)