public void CancelTicketTest()
        {
            TestData.DeleteAllData();
            getTokenAndGetFacade(out LoginToken <Admin> tokenAdmin, out LoggedInAdministratorFacade facadeAdmin,
                                 out LoginToken <Customer> tokenCustomer, out LoggedInCustomerFacade fasadeCustomer);
            flightDAOPGSQL.Add(CreateFlightForTest());
            var f = flightDAOPGSQL.GetAll()[0];

            fasadeCustomer.PurchaseTicket(tokenCustomer, f);
            var t = ticketDAOPGSQL.GetAll()[0];

            fasadeCustomer.CancelTicket(tokenCustomer, t, f);

            Assert.AreEqual(flightDAOPGSQL.GetAll()[0].Tickets_Remaining, TestData.CreateFlight_TicketsRemaining);
            Assert.AreEqual(null, ticketDAOPGSQL.Get((int)t.Id));
        }
Ejemplo n.º 2
0
        public void GetAllFlightsTest()
        {
            AnonymousUserFacade facade = FlightsCenterSystem.GetInstance().GetFacade <Anonymous>(null) as AnonymousUserFacade;

            TestData.DeleteAllData();

            flightDAOPGSQL.Add(CreateFlightForTest());

            var f_list = facade.GetAllFlights();

            Assert.AreNotEqual(f_list, null);
            Assert.AreEqual(f_list.Count, 1);
        }