Exemple #1
0
        public void d2_IsgetCustomerBookingCorrect()
        {
            testActivityObj.bookSeats(0, 2, testCustObj1);

            Sales.Invoice actual1   = testActivityObj.getCustomerBooking(testCustObj1);
            Sales.Invoice expected1 = testInvoiceObj;

            //variables AreEqual & AreNotEqual
            Assert.AreEqual(expected1.getPriceCode(), actual1.getPriceCode(), "Price code not equal");
            Assert.AreNotEqual(expected1.getTheCust(), actual1.getTheCust(), "The Customers equal");
            Assert.AreEqual(expected1.getRowNum(), actual1.getRowNum(), "Row num not equal");
            Assert.AreEqual(expected1.getStartSeatNum(), actual1.getStartSeatNum(), "Start seat number not equal");
            Assert.AreEqual(expected1.getNumberOfSeats(), actual1.getNumberOfSeats(), "No of seats not equal");

            //Assert.AreEqual(expected1, actual1, "???");
            //This will not work for comparing object's data without a getter in source code similar to getTheCust().
        }
Exemple #2
0
        public void Init()
        {
            //Flight(int economyRows, int economySeats, int firstClassRows, int firstClassSeats)
            testFlightObj = new Sales.Flight(20, 160, 5, 20);

            //Activity(Flight theFlight)
            testActivityObj = new Sales.Activity(testFlightObj);

            //Customer(int memberType, String firstName, String lastName, String creditNumber, String creditType, String expiry)
            testCustObj  = new Sales.Customer(1, "Raja", "Arumuga", "1000200030004000", "Visa", "11/22");
            testCustObj1 = new Sales.Customer(1, "KT", "Lau", "1000200030004000", "Visa", "01/20");

            //Invoice(int priceCode, Customer theCust, int rowNum, int startSeatNum, int seatsBooked)
            testInvoiceObj  = new Sales.Invoice(0, testCustObj, 1, 1, 2);
            testInvoiceObj1 = new Sales.Invoice(0, testCustObj, 1, 1, 2);
            testInvoiceObj2 = new Sales.Invoice(1, testCustObj, 1, 1, 2);
            testInvoiceObj3 = new Sales.Invoice(1, testCustObj1, 1, 1, 2);

            //Seat(int numAvail, int code) code is priceCode
            testSeatObj = new Sales.Seat(160, 0);
        }