public AirlineReservation() { // Inject dependencies this.WaitlistService = new WaitlistService(); this.AirplaneService = new AirplaneService(); InitializeComponent(); }
public AirplaneView() { this.InitializeComponent(); _airplaneService = new AirplaneService(); _airplaneTypeService = new AirplaneTypeService(); AirplaneDtos = new ObservableCollection <AirplaneDto>(); AirplaneTypeDtos = new ObservableCollection <AirplaneTypeDto>(); SelectedItem = new AirplaneDto(); AirplaneTypesList.ItemsSource = AirplaneDtos; HideDetailFields(); HideAddAndSaveButtons(); }
public void AirplaneService_CheckInsert_ThrowNameException() { // Arrange var mock = new Mock<IAirplaneRepository>(); mock.Setup(repo => repo.Create(new AirplaneEntity())) .Returns(() => Task.CompletedTask); var service = new AirplaneService(mock.Object); // Act var ex = Assert.ThrowsAnyAsync<NameException>(() => service.Create(new Airplane())); // Assert Assert.Equal("The Airplane have not empty or null name.", ex.Result.Message); }
public void AirplaneService_CheckInsert_Created() { // Arrange var mock = new Mock<IAirplaneRepository>(); mock.Setup(repo => repo.Create(StubsObjects.Airplane.ToEntity())) .Returns(() => Task.CompletedTask); var service = new AirplaneService(mock.Object); // Act var result = service.Create(StubsObjects.Airplane).Result; // Assert Assert.Equal(StatusCode.Created, result); }
public AeroplanoController(AirplaneService service) { _service = service; }
public AirplanesController(AirplaneService airplaneService) { _airplaneService = airplaneService; }