Пример #1
0
 /// <summary>
 /// Pat Banks
 /// Created:  2015/03/03
 /// Populates form fields
 /// </summary>
 private void FillFormFields()
 {
     CurrentInvoice.TotalPaid   = _invoiceManager.CalculateTotalDue(_myBookingList);
     LblGuestNameLookup.Content = _guestToView.GetFullName;
     LblCheckInDate.Content     = CurrentInvoice.DateOpened.ToString(CultureInfo.InvariantCulture);
     LblInvoice.Content         = CurrentInvoice.InvoiceID.ToString();
     LblAddress.Content         = _guestToView.Address1;
     LblCityState.Content       = _guestToView.CityState.GetZipStateCity;
     LblPhoneNum.Content        = _guestToView.PhoneNumber;
     LblRoomNum.Content         = _guestToView.Room;
     LblInvoice.Content         = CurrentInvoice.InvoiceID;
     LblTotalPrice.Content      = CurrentInvoice.GetTotalFormat;
     LblEmail.Content           = _guestToView.EmailAddress;
     LblPhoneNum.Content        = _guestToView.PhoneNumber;
 }
Пример #2
0
        public void InvoiceManagerCalculateDue()
        {   //Updated: Create a list of booking details
            List <BookingDetails> guestBookings = new List <BookingDetails>();
            //Creates two fake Total Charges to be added to the guestBookings list
            BookingDetails test = new BookingDetails();

            test.TotalCharge = 40m;
            BookingDetails test2 = new BookingDetails();

            test2.TotalCharge = 50m;
            //Fake BookingDetails added
            guestBookings.Add(test);
            guestBookings.Add(test2);
            //Calculates by calling manager method to test
            decimal amount = access.CalculateTotalDue(guestBookings);

            //Asserts that 90 will be returned.
            Assert.AreEqual((decimal)90, amount);
        }