示例#1
0
        public void UpdateFlightTest()
        {
            t.ClearDataBase();
            Flight         flight = t.CreateFlightForTests();
            FlightDAOMSSQL DAO    = new FlightDAOMSSQL();

            Assert.AreEqual(DAO.Get(flight.ID).REMAINGING_TICKETS, flight.REMAINGING_TICKETS);
            flight.REMAINGING_TICKETS = 200;
            t.airlinecompanyFacade.UpdateFlight(t.airlinecompanyToken, flight);
            Assert.AreEqual(DAO.Get(flight.ID).REMAINGING_TICKETS, flight.REMAINGING_TICKETS);
        }
示例#2
0
        public void UpdateFlightTest()
        {
            Flight Flight = new Flight(TestCenter.AirlineToken.User.Id, TestCenter.AirlineToken.User.CountryCode, TestCenter.AirlineToken.User.CountryCode, new DateTime(2020, 10, 10, 10, 00, 00), new DateTime(2020, 10, 11, 10, 00, 00), 100);

            TestCenter.AirlineFacade.CreateFlight(TestCenter.AirlineToken, Flight);
            FlightDAOMSSQL F = new FlightDAOMSSQL();

            Flight.RemainingTickets = 200;
            Assert.AreNotEqual(F.Get(Flight.Id).RemainingTickets, Flight.RemainingTickets);
            TestCenter.AirlineFacade.UpdateFlight(TestCenter.AirlineToken, Flight);
            Assert.AreEqual(F.Get(Flight.Id).RemainingTickets, Flight.RemainingTickets);
        }
        public void TestUpdadteFlight()
        {
            test = new TestInfo();
            Country testCountry1 = new Country("usa");
            Country testCountry2 = new Country("italy");

            testCountry1.ID = test.adminF.CreateNewCountry(test.adminT, testCountry1);
            testCountry2.ID = test.adminF.CreateNewCountry(test.adminT, testCountry2);
            Flight flight = new Flight(test.airlineT.User.ID, testCountry1.ID, testCountry2.ID, DateTime.ParseExact("2019-07-08 07:00:00", "yyyy-MM-dd HH:mm:ss", null), DateTime.ParseExact("2019-07-18 17:00:00", "yyyy-MM-dd HH:mm:ss", null), 5);

            flight.ID = test.airlineF.CreateFlight(test.airlineT, flight);
            FlightDAOMSSQL Fdao = new FlightDAOMSSQL();

            flight.RemaniningTickets = 4;
            Assert.AreNotEqual(Fdao.Get(flight.ID).RemaniningTickets, flight.RemaniningTickets);
            test.airlineF.UpdateFlight(test.airlineT, flight);
            Assert.AreEqual(Fdao.Get(flight.ID).RemaniningTickets, flight.RemaniningTickets);
        }