test: enhance DocSignedNotificationTests with AutoMapper and notification mapping
This commit is contained in:
parent
796c59cd38
commit
cb0c361cdb
@ -1,15 +1,23 @@
|
||||
using DigitalData.Core.Abstraction.Application;
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||
using EnvelopeGenerator.Application.Common.Notifications.DocSigned;
|
||||
using EnvelopeGenerator.Application.Common.Notifications.DocSigned.Handlers;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Dynamic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EnvelopeGenerator.Tests.Application;
|
||||
|
||||
public class DocSignedNotificationTests : TestBase
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
protected IMapper _mapper;
|
||||
|
||||
public override Task Setup()
|
||||
{
|
||||
return base.Setup();
|
||||
_mapper = Host.Services.GetRequiredService<IMapper>();
|
||||
}
|
||||
|
||||
[TestCase("h.tek@digitaldata.works")]
|
||||
@ -30,10 +38,12 @@ public class DocSignedNotificationTests : TestBase
|
||||
|
||||
// Create envelope receiver
|
||||
var envRcv = this.CreateEnvelopeReceiver(env!.Id, rcv.Id);
|
||||
await Repository.CreateAsync<EnvelopeReceiver>(envRcv, cancel);
|
||||
envRcv = await Repository.CreateAsync(envRcv, cancel);
|
||||
var envRcvDto = _mapper.Map<EnvelopeReceiverDto>(envRcv);
|
||||
envRcvDto.ToDocSignedNotification(new () { });
|
||||
|
||||
// Act
|
||||
|
||||
// create action part
|
||||
|
||||
Assert.Pass();
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ namespace EnvelopeGenerator.Tests.Application;
|
||||
|
||||
public class TestBase : Faker
|
||||
{
|
||||
private Fake.Host Host;
|
||||
protected Fake.Host Host;
|
||||
|
||||
protected User User => Host.User;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user