Updated ef migrations.
This commit is contained in:
@@ -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)
|
||||
|
||||
+1
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user