Beispiel #1
0
        public async Task GetAllFlightsWithoutSyncAll()
        {
            // Arrange
            List <Flight> flightsExpected = (List <Flight>)FlightsControllerTests.GetTestFlights();

            FlightsController controller = ArrangeForSyncTests(false, flightsExpected);

            // Act

            ActionResult <IEnumerable <Flight> > response =
                await controller.GetAllFlights("2020-11-27T01:56:22Z");

            // Assert

            // Checks if response is ok and that lists are equal.
            Assert.IsType <OkObjectResult>(response.Result);
            OkObjectResult result        = (OkObjectResult)response.Result;
            List <Flight>  flightsResult = (List <Flight>)result.Value;

            CheckIfListsAreEqual(flightsExpected, flightsResult);
        }
Beispiel #2
0
        public async Task GetAllFlightsWithSyncAll()
        {
            // Arrange
            List <Flight> flightsWithSyncExpected = (List <Flight>)FlightsControllerTests.GetTestFlights();

            flightsWithSyncExpected.Add(new Flight("asf", 1243.12, 1242.12, 200,
                                                   "ELAL", "2020-11-27T01:56:22Z", true));
            // true means that you have sync all
            FlightsController controller = ArrangeForSyncTests(true, flightsWithSyncExpected);

            // Act

            ActionResult <IEnumerable <Flight> > response =
                await controller.GetAllFlights("2020-11-27T01:56:22Z");

            // Assert

            // Checks if response is ok and that lists are equal.
            Assert.IsType <OkObjectResult>(response.Result);
            OkObjectResult result        = (OkObjectResult)response.Result;
            List <Flight>  flightsResult = (List <Flight>)result.Value;

            CheckIfListsAreEqual(flightsWithSyncExpected, flightsResult);
        }