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);
        }
        public void SetHostclearslist()
        {
            var sut  = new AllocationsListVM();
            var list = new List <AccountAllocation>
            {
                new AccountAllocation(),
                new AccountAllocation(),
                new AccountAllocation(),
            };

            sut.Add(new AccountAllocation());
            sut.Add(new AccountAllocation());

            sut.SetHost(list, null, null);

            sut.Should().HaveCount(3);
        }
        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);
        }
Example #4
0
 public FundRequestCrudVM(ITenantDBsDir dir) : base(dir.Vouchers.ActiveRequests, dir)
 {
     Allocations = new AllocationsListVM();
 }