Re-layout source code to correct namespaces (handlers, commands, etc.)

This commit is contained in:
2026-07-17 16:57:55 +02:00
parent 09a89a34c4
commit 69cb05f389
25 changed files with 89 additions and 85 deletions
@@ -1,4 +1,7 @@
using FinancialApi.Domain;
using System.Security.Cryptography;
using FinancialApi.Application.Commands;
using FinancialApi.Application.Handlers;
using FinancialApi.Domain;
using FluentAssertions;
using FluentAssertions.Execution;
@@ -12,19 +15,18 @@ public class ApplyFeeHandlerTests
// Arrange
var command = new ApplyFeeCommand(1, 100);
var account = new Account(1, 100, "Debit");
var destAccount = new Account(99999, 100, "Credit");
var pair = new FeePair(account, destAccount, TimeProvider.System.GetUtcNow());
var revenueAccount = new Account(99999, 0, "Credit");
var pair = new FeePair(account, revenueAccount, TimeProvider.System.GetUtcNow());
// Act
var intents = ApplyFeeHandler.Handle(command, pair);
// Assert
using var _ = new AssertionScope();
intents.CustomerWrite.Entity.Balance.Should().Be(0);
intents.RevenueWrite.Entity.Balance.Should().Be(200);
intents.RevenueWrite.Entity.Balance.Should().Be(200);
intents.JournalWrite.Entity.Lines.Count.Should().Be(2);
intents.CustomerWrite.Entity.Balance.Should().Be(account.Balance - command.Amount);
intents.RevenueWrite.Entity.Balance.Should().Be(revenueAccount.Balance + command.Amount);
intents.JournalWrite.Entity.Lines.Count.Should().BeGreaterThanOrEqualTo(2);
intents.Event.AccountId.Should().Be(account.Id);
intents.Event.Amount.Should().Be(100);
intents.Event.Amount.Should().Be(command.Amount);
}
}