Esempio n. 1
0
        public void GetFlightByName()
        {
            // Arrange
            _persistenceServiceMock.Setup(x => x.GetFlight(_flightName)).Returns(new Flight(_flightName));
            // Act
            var flight = _flightSimulatorService.GetFlight(_flightName);

            // Assert
            flight.Name.Should().Be(_flightName);
        }
        public IActionResult Edit(string flightName)
        {
            if (!string.IsNullOrEmpty(flightName))
            {
                var flight = _flightSimulatorService.GetFlight(flightName);
                if (flight != null)
                {
                    return(View(flight.ToFlightModel()));
                }
            }

            return(View());
        }