Example #1
0
        public void CreateEntity_Should_Create_flight_typeof_Flight()
        {
            // Arrange
            FlightDTO flightDTO = new FlightDTO
            {
                Id               = 1,
                Number           = 1111,
                PointOfDeparture = "Lviv",
                Destination      = "London",
                DepartureTime    = new DateTime(2018, 07, 12),
                DestinationTime  = new DateTime(2018, 07, 12)
            };
            Flight flight = new Flight
            {
                Id               = 1,
                Number           = 1111,
                PointOfDeparture = "Lviv",
                Destination      = "London",
                DepartureTime    = new DateTime(2018, 07, 12),
                DestinationTime  = new DateTime(2018, 07, 12)
            };

            var flightRepository = new FakeRepository <Flight>();
            var flightService    = new FlightService(flightRepository);

            // Act
            flightService.CreateEntity(flightDTO);
            var result = flightRepository.Get(1);

            // Assert
            Assert.AreEqual(flight, result);
        }
 public void AddFlight()
 {
     service.CreateEntity(SelectedFlight);
     FillFlightsCollection();
 }