Updated ef migrations.

This commit is contained in:
2026-07-29 13:03:30 +02:00
parent 44846eaa13
commit acc8423fc6
10 changed files with 410 additions and 22 deletions
@@ -5,6 +5,29 @@ namespace FinancialApi.Application.UnitTests;
public class AccountTests
{
[Theory]
[InlineData(AccountType.Credit)]
public void CreateCreditAccountType_ShouldAllowNegativeBalance(AccountType accountType)
{
var act = () => new Account(1, -100, accountType);
act()
.Balance.Should()
.BeNegative();
}
[Theory]
[InlineData(AccountType.Debit)]
[InlineData(AccountType.Revenue)]
[InlineData(AccountType.Liability)]
public void CreateDebitAccountType_ShouldNotAllowNegativeBalance(AccountType accountType)
{
var act = () => new Account(1, -100, accountType);
act.Should()
.Throw<InvalidStartingBalanceException>();
}
[Theory]
[InlineData(AccountType.Credit)]
public void GivenCreditAccountType_ShouldAllowNegativeBalance(AccountType accountType)
@@ -50,6 +50,7 @@ public class ApplyFeeHandlerTests
decimal expectedBalance
)
{
// Arrange
var command = new ApplyFeeCommand(1, feeAmount);
var account = new Account(1, startingBalance, AccountType.Liability);
var revenueAccount = new Account(99999, 0, AccountType.Credit);
@@ -83,10 +84,6 @@ public class ApplyFeeHandlerTests
using var _ = new AssertionScope();
act.Should()
.Throw<InsufficientFundsException>();
account.Balance.Should()
.Be(startingBalance);
revenueAccount.Balance.Should()
.Be(0);
}
}