Beispiel #1
0
        public void TestBillDetailCanLoadCorrectWhenClickingOnBillOnBillSearch()
        {
            NavigatorViewModel nav = new NavigatorViewModel();

            nav.ViewNameToDisplay = Constants.BillSearchView;
            MockBillReaderWriter billReaderWriter = new MockBillReaderWriter();
            BillSearchViewModel  bs = new BillSearchViewModel(billReaderWriter, nav);

            var allBills = billReaderWriter.GetAllBills();

            bs.SelectedBill = allBills[1];
            bs.OnGridDataRowClicked.Execute(null);

            Assert.AreEqual(nav.ViewNameToDisplay, Constants.BillDetailView);
            Assert.AreEqual(nav.BillIdSelected, 2);
            Assert.IsTrue(bs.SelectedBill.SameData(new BillInfo()));
        }
Beispiel #2
0
        public void TestBillDetailLoadWillSetBillInfo()
        {
            MockBillReaderWriter readerWriter = new MockBillReaderWriter();
            IList <BillInfo>     allBills     = readerWriter.GetAllBills();

            NavigatorViewModel nav = new NavigatorViewModel();

            nav.BillIdSelected = 2;
            BillDetailViewModel billDetail = new BillDetailViewModel(readerWriter, null, nav);

            BillInfo billInBillDetailModel = new BillInfo()
            {
                Amount        = billDetail.Amount,
                BillName      = billDetail.BillName,
                Description   = billDetail.Description,
                DueDate       = billDetail.DueDate,
                Type          = billDetail.BillType,
                IsAlreadyPaid = billDetail.IsAlreadyPaid,
                Attachement   = billDetail.Attachement
            };

            Assert.IsTrue(billInBillDetailModel.SameData(allBills[1]));
        }