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 { protected IMapper _mapper; public override Task Setup() { return base.Setup(); _mapper = Host.Services.GetRequiredService(); } [TestCase("h.tek@digitaldata.works")] public async Task Test1(string emailAddress) { CancellationToken cancel = new(); /// Assert var mediator = Mediator; // Create envelope var envCmd = this.CreateEnvelopeCommand(User.Id); var env = await mediator.Send(envCmd, cancel); // Create receiver var rcvCmd = this.CreateReceiverCommand(emailAddress); (var rcv, _) = await mediator.Send(rcvCmd, cancel); // Create envelope receiver var envRcv = this.CreateEnvelopeReceiver(env!.Id, rcv.Id); envRcv = await Repository.CreateAsync(envRcv, cancel); var envRcvDto = _mapper.Map(envRcv); envRcvDto.ToDocSignedNotification(new () { }); // Act // create action part Assert.Pass(); } }