コード例 #1
0
        public void EffectiveBalancesNoTransactions()
        {
            var account = new CashAccount();

            var result = account.EffectiveBalances(new DateRange(new Date(2000, 01, 01), new Date(2010, 01, 01))).ToArray();

            var expectedResult = new CashAccountEffectiveBalance[]
            {
                new CashAccountEffectiveBalance(new Date(2000, 01, 01), new Date(2010, 01, 01), 0.00m)
            };

            result.Should().BeEquivalentTo(expectedResult);
        }
コード例 #2
0
        public void EffectiveBalancesStartAndEndDatesNotMatching()
        {
            var account = new CashAccount();

            account.Deposit(new Date(2000, 01, 01), 100.00m, "");
            account.Deposit(new Date(2000, 02, 01), 200.00m, "");
            account.Deposit(new Date(2000, 02, 01), 60.00m, "");
            account.Withdraw(new Date(2000, 03, 01), 50.00m, "");

            var result = account.EffectiveBalances(new DateRange(new Date(2000, 01, 15), new Date(2000, 02, 15))).ToArray();

            var expectedResult = new CashAccountEffectiveBalance[]
            {
                new CashAccountEffectiveBalance(new Date(2000, 01, 15), new Date(2000, 01, 31), 100.00m),
                new CashAccountEffectiveBalance(new Date(2000, 02, 01), new Date(2000, 02, 15), 360.00m),
            };

            result.Should().BeEquivalentTo(expectedResult);
        }