using MyOffice.Services.Account;

namespace MyOffice.Tests.Accounts;

public class AccountMotionBalancingTests
{
	[Fact]
	public void ResolveAmounts_income_primary_creates_expense_on_balancing()
	{
		var (plus, minus) = AccountMotionBalancing.ResolveAmounts(primaryPlus: 100m, amountBalancing: 100m);

		Assert.Equal(0m, plus);
		Assert.Equal(100m, minus);
	}

	[Fact]
	public void ResolveAmounts_expense_primary_creates_income_on_balancing()
	{
		var (plus, minus) = AccountMotionBalancing.ResolveAmounts(primaryPlus: 0m, amountBalancing: 50m);

		Assert.Equal(50m, plus);
		Assert.Equal(0m, minus);
	}

	[Fact]
	public void BalancingItemName_prefixes_account_name()
	{
		Assert.Equal("+Wallet", AccountMotionBalancing.BalancingItemName("Wallet"));
	}
}
