refactor(HistoryTests): create and implement TestBase

This commit is contained in:
2025-09-01 15:19:52 +02:00
parent 950ae5a418
commit bb93b980b4
2 changed files with 45 additions and 19 deletions

View File

@@ -0,0 +1,31 @@
using Bogus;
using DigitalData.UserManager.Domain.Entities;
using EnvelopeGenerator.Application.Envelopes.Commands;
using EnvelopeGenerator.Application.Receivers.Commands;
using MediatR;
namespace EnvelopeGenerator.Tests.Application;
public class TestBase : Faker
{
private Fake.Host Host;
public User User => Host.User;
public IMediator Mediator => Host.Mediator;
public CreateEnvelopeCommand FakeCreateEnvelopeCommand => this.CreateEnvelopeCommand(Host.User.Id);
[SetUp]
public virtual async Task Setup()
{
Host = Fake.CreateHost();
await Host.AddSamples();
}
[TearDown]
public virtual void TearDown()
{
Host.Dispose();
}
}