Пример #1
0
        public async Task CreateAircraft_WhenAircraftValid_ReturnNewAircraft()
        {
            AircraftDto aircraft = new AircraftDto()
            {
                AircraftName   = "TEST",
                TypeAircraftId = 1
            };
            AircraftDto aircraftDtoSaved = await service.Create(aircraft);

            Assert.AreEqual(aircraft.AircraftName, aircraftDtoSaved.AircraftName);
            Assert.AreEqual(aircraft.TypeAircraftId, aircraftDtoSaved.TypeAircraftId);

            bool result = await service.Delete <Aircraft>(aircr => aircr.Id == aircraftDtoSaved.Id);

            Assert.IsTrue(result);
        }
Пример #2
0
        public async Task Delete()
        {
            await AircraftService.Delete(Aircraft.Id);

            Aircraft = new Aircraft();
            NotifyPropertyChanged(() => Aircraft);
            List <Aircraft> tempAircrafts = await AircraftService.GetAll();

            Aircrafts = new ObservableCollection <Aircraft>();
            foreach (var fl in tempAircrafts)
            {
                Aircrafts.Add(fl);
            }
            NotifyPropertyChanged(() => Aircrafts);
        }