Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion TransactionProcessor.Aggregates/FloatActivityAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace TransactionProcessor.Aggregates
{
public static class FloatActivityAggregateExtensions
{

public static void PlayEvent(this FloatActivityAggregate aggregate,
FloatActivityDomainEvents.FloatAggregateCreditedEvent domainEvent)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using TransactionProcessor.BusinessLogic.EventHandling;
using TransactionProcessor.BusinessLogic.Events;
using TransactionProcessor.BusinessLogic.Requests;
using TransactionProcessor.BusinessLogic.Services;
using TransactionProcessor.DomainEvents;
using TransactionProcessor.Repository;
using TransactionProcessor.Testing;
Expand All @@ -22,16 +23,13 @@ namespace TransactionProcessor.BusinessLogic.Tests.DomainEventHandlers
{
public class MerchantDomainEventHandlerTests : DomainEventHandlerTests
{
private readonly Mock<IAggregateRepository<MerchantAggregate, DomainEvent>> MerchantAggregateRepository;
private readonly Mock<ITransactionProcessorReadModelRepository> TransactionProcessorReadModelRepository;
private readonly MerchantDomainEventHandler DomainEventHandler;

public MerchantDomainEventHandlerTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) {
this.MerchantAggregateRepository = new Mock<IAggregateRepository<MerchantAggregate, DomainEvent>>();
this.TransactionProcessorReadModelRepository = new Mock<ITransactionProcessorReadModelRepository>();

this.DomainEventHandler = new MerchantDomainEventHandler(this.MerchantAggregateRepository.Object,
this.TransactionProcessorReadModelRepository.Object,
this.DomainEventHandler = new MerchantDomainEventHandler(this.TransactionProcessorReadModelRepository.Object,
this.Mediator.Object);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using SimpleResults;
using TransactionProcessor.Aggregates;
using TransactionProcessor.BusinessLogic.Services;
using TransactionProcessor.Database.Contexts;
using TransactionProcessor.Database.Entities;

Expand Down Expand Up @@ -67,8 +68,8 @@ public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithEmailAddress_
Mock<ISecurityServiceClient> securityServiceClient = new Mock<ISecurityServiceClient>();
securityServiceClient.Setup(s => s.GetToken(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(Result.Success(TestData.TokenResponse()));

Mock<IAggregateRepository<VoucherAggregate, DomainEvent>> voucherAggregateRepository = new Mock<IAggregateRepository<VoucherAggregate, DomainEvent>>();
voucherAggregateRepository.Setup(t => t.GetLatestVersion(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
Mock<IAggregateService> aggregateService = new();
aggregateService.Setup(t => t.Get<VoucherAggregate>(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
.ReturnsAsync(Result.Success(TestData.GetVoucherAggregateWithRecipientEmail()));

EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory);
Expand Down Expand Up @@ -98,7 +99,7 @@ public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithEmailAddress_
});

VoucherDomainEventHandler voucherDomainEventHandler = new VoucherDomainEventHandler(securityServiceClient.Object,
voucherAggregateRepository.Object,
aggregateService.Object,
dbContextFactory.Object,
messagingServiceClient.Object,
fileSystem);
Expand All @@ -116,8 +117,8 @@ public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithRecipientMobi
Mock<ISecurityServiceClient> securityServiceClient = new Mock<ISecurityServiceClient>();
securityServiceClient.Setup(s => s.GetToken(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<CancellationToken>())).ReturnsAsync(Result.Success(TestData.TokenResponse()));

Mock<IAggregateRepository<VoucherAggregate, DomainEvent>> voucherAggregateRepository = new Mock<IAggregateRepository<VoucherAggregate, DomainEvent>>();
voucherAggregateRepository.Setup(t => t.GetLatestVersion(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
Mock<IAggregateService> aggregateService = new ();
aggregateService.Setup(t => t.Get<VoucherAggregate>(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
.ReturnsAsync(Result.Success(TestData.GetVoucherAggregateWithRecipientMobile()));

EstateManagementGenericContext context = await this.GetContext(Guid.NewGuid().ToString("N"), TestDatabaseType.InMemory);
Expand Down Expand Up @@ -147,7 +148,7 @@ public async Task VoucherDomainEventHandler_VoucherIssuedEvent_WithRecipientMobi
});

VoucherDomainEventHandler voucherDomainEventHandler = new VoucherDomainEventHandler(securityServiceClient.Object,
voucherAggregateRepository.Object,
aggregateService.Object,
dbContextFactory.Object,
messagingServiceClient.Object,
fileSystem);
Expand Down
Loading
Loading