public async Task SetUp()
 {
     _httpClient      = _testHostFixture.Client;
     _serviceProvider = _testHostFixture.ServiceProvider;
     TestsDAOPGSQL.ClearDB();
     await TestHelpers.Create_Country_For_Tests(_httpClient);
 }
Beispiel #2
0
        public async Task SetUp()
        {
            _httpClient = _testHostFixture.Client;
            TestsDAOPGSQL.ClearDB();
            await TestHelpers.Create_Country_For_Tests(_httpClient);

            await TestHelpers.Create_Country_For_Tests(_httpClient, new CreateCountryDTO { Name = "Usa" });

            await TestHelpers.Create_Country_For_Tests(_httpClient, new CreateCountryDTO { Name = "Russia" });

            await TestHelpers.Create_Country_For_Tests(_httpClient, new CreateCountryDTO { Name = "Italy" });

            await TestHelpers.Airline_Company_Login(_httpClient);

            CreateFlightDTO createFlightDTO = new CreateFlightDTO
            {
                OriginCountryId      = 1,
                DestinationCountryId = 2,
                DepartureTime        = DateTime.Now.AddDays(1),
                LandingTime          = DateTime.Now.AddDays(2),
                RemainingTickets     = 15
            };
            await TestHelpers.Create_Flight_For_Tests(_httpClient, createFlightDTO);

            CreateFlightDTO createFlightDTO2 = new CreateFlightDTO
            {
                OriginCountryId      = 1,
                DestinationCountryId = 2,
                DepartureTime        = DateTime.Now.AddDays(2),
                LandingTime          = DateTime.Now.AddDays(3),
                RemainingTickets     = 15
            };
            await TestHelpers.Create_Flight_For_Tests(_httpClient, createFlightDTO2);

            CreateFlightDTO createFlightDTO3 = new CreateFlightDTO
            {
                OriginCountryId      = 3,
                DestinationCountryId = 4,
                DepartureTime        = DateTime.Now.AddDays(2),
                LandingTime          = DateTime.Now.AddDays(3),
                RemainingTickets     = 15
            };
            await TestHelpers.Create_Flight_For_Tests(_httpClient, createFlightDTO3);

            CreateFlightDTO createFlightDTO4 = new CreateFlightDTO
            {
                OriginCountryId      = 3,
                DestinationCountryId = 4,
                DepartureTime        = DateTime.Now.AddDays(4),
                LandingTime          = DateTime.Now.AddDays(5),
                RemainingTickets     = 15
            };
            await TestHelpers.Create_Flight_For_Tests(_httpClient, createFlightDTO4);

            CreateFlightDTO createFlightDTO5 = new CreateFlightDTO
            {
                OriginCountryId      = 2,
                DestinationCountryId = 4,
                DepartureTime        = DateTime.Now.AddDays(1),
                LandingTime          = DateTime.Now.AddDays(2),
                RemainingTickets     = 15
            };
            await TestHelpers.Create_Flight_For_Tests(_httpClient, createFlightDTO5);
        }
 public void SetUp()
 {
     _httpClient      = _testHostFixture.Client;
     _serviceProvider = _testHostFixture.ServiceProvider;
     TestsDAOPGSQL.ClearDB();
 }