Exemplo n.º 1
0
        public void OnvalidamountenterecreatesCashinbankentry()
        {
            var sut  = new AllocationsListVM();
            var host = new List <AccountAllocation>();
            var bank = BankAccountDTO.Named("test bank acct");
            var amt  = 123;

            sut.SetHost(host, bank, null);

            sut.OnAmountChanged(amt);

            sut.Should().HaveCount(1);
            sut[0].Account.Name.Should().Contain("Cash in Bank");
            sut[0].Account.Name.Should().Contain(bank.Name);
            sut[0].SubAmount.Should().Be(amt);
        }
Exemplo n.º 2
0
        public void HasItemamountchangedupdatesitem()
        {
            var sut  = new AllocationsListVM();
            var bank = BankAccountDTO.Named("test bank acct");
            var item = new AccountAllocation {
                Account = GLAccountDTO.CashInBank(bank), SubAmount = 123
            };
            var host = new List <AccountAllocation> {
                item
            };
            var amt = 456;

            sut.SetHost(host, bank, null);

            sut.OnAmountChanged(amt);

            sut.Should().HaveCount(1);
            sut[0].Account.Name.Should().Contain("Cash in Bank");
            sut[0].Account.Name.Should().Contain(bank.Name);
            sut[0].SubAmount.Should().Be(amt);
        }