Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Moq;
using Shared.DomainDrivenDesign.EventSourcing;
using Shared.EventStore.Aggregate;
using Shared.Logger;
using Shared.Serialisation;
using Shouldly;
using SimpleResults;
Expand Down Expand Up @@ -33,6 +34,7 @@ public class TransactionProcessorManagerTests

public TransactionProcessorManagerTests()
{
Logger.Initialise(Microsoft.Extensions.Logging.Abstractions.NullLogger.Instance);
this.TransactionProcessorReadModelRepository = new Mock<ITransactionProcessorReadModelRepository>();
StringSerialiser.Initialise(new Shared.Serialisation.SystemTextJsonSerializer(new System.Text.Json.JsonSerializerOptions()));
this.AggregateService = new Mock<IAggregateService>();
Expand Down Expand Up @@ -447,6 +449,19 @@ public async Task TransactionProcessorManager_GetMerchantContracts_RepoCallFaile
getMerchantContractsResult.IsFailed.ShouldBeTrue();
}

[Fact]
public async Task TransactionProcessorManager_GetMerchantContracts_RepositoryThrows_ResultFailed()
{
this.TransactionProcessorReadModelRepository
.Setup(e => e.GetMerchantContracts(It.IsAny<Guid>(), It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
.ThrowsAsync(new Exception("Test exception"));

Result<List<Contract>> getMerchantContractsResult = await this.TransactionProcessorManager.GetMerchantContracts(TestData.EstateId, TestData.MerchantId, CancellationToken.None);

getMerchantContractsResult.IsFailed.ShouldBeTrue();
getMerchantContractsResult.Message.ShouldBe("Test exception");
}

[Fact]
public async Task TransactionProcessorManager_GetMerchants_MerchantListIsReturned()
{
Expand Down
Loading