refactor(HistoryTests): create and implement TestBase
This commit is contained in:
31
EnvelopeGenerator.Tests.Application/TestBase.cs
Normal file
31
EnvelopeGenerator.Tests.Application/TestBase.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user