public void Get()
        {
            Customer theCustomer = new Customer("FIRSTNAME", "LASTNAME", "USERNAME", "PASSWORD", "ADDRESS", "PHNUMBER", "CRDNUMBER");

            customerDAO.Add(theCustomer);
            theCustomer = customerDAO.GetAll()[0];

            Country israel = new Country("Israel");

            countryDAO.Add(israel);
            israel = countryDAO.GetAll()[0];

            AirlineCompany elal = new AirlineCompany("ELAL", "ELALUSERNAME", "ELALPASSWORD", israel.ID);

            airlineDAO.Add(elal);
            elal = airlineDAO.GetAll()[0];

            Flight theFlight = new Flight(elal.ID, israel.ID, israel.ID, new DateTime((DateTime.Now.Year + 2), 12, 5, 14, 00, 00), new DateTime((DateTime.Now.Year + 2), 12, 7, 14, 00, 00), 50, FlightStatus.NotDeparted);

            flightDAO.Add(theFlight);
            theFlight = flightDAO.GetAll()[0];

            Ticket theTicket = new Ticket(theFlight.ID, theCustomer.ID);

            ticketDAO.Add(theTicket);
            theTicket = ticketDAO.GetAll()[0];

            Assert.AreEqual(theTicket, ticketDAO.Get(theTicket.ID));
        }
Example #2
0
        public void CancelTicket_Test()
        {
            Ticket ticket = _ticketDAO.Get(15);

            FlightCenterSystem.Instance.Login(out FacadeBase facadeBase, out ILoginToken token, "uri321", "vzd474");
            LoginToken <Customer>  loginToken = (LoginToken <Customer>)token;
            LoggedInCustomerFacade facade     = (LoggedInCustomerFacade)facadeBase;

            facade.CancelTicket(loginToken, ticket);
            Flight flight = _flightDAO.Get(9);

            Assert.AreEqual(flight.Remaining_Tickets, 45);
        }