Пример #1
0
        public async Task Search()
        {
            Aircrafts.Clear();

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

            foreach (var item in tempAircrafts)
            {
                Aircrafts.Add(item);
            }
        }
        public void GetDetails_Should_ReturnAircraft_When_Called()
        {
            var plane  = _aircraftService.GetAll().First();
            var result = _aircraftService.GetDetails(plane.Id);

            Assert.AreEqual(plane.Id, result.Id);
        }
Пример #3
0
        public void GetAll_Should_ReturnListAircraftsDTO_When_Called()
        {
            A.CallTo(() => _fakeMapper.Map <List <Aircraft>, List <DTO.Aircraft> >(A <List <Aircraft> > .That.Contains(_plane1)))
            .Returns(new List <DTO.Aircraft> {
                _plane1DTO
            });
            A.CallTo(() => _fakeUnitOfWork.AircraftRepository.Get(null)).Returns(new List <Aircraft> {
                _plane1
            });
            List <DTO.Aircraft> result = _aircraftService.GetAll();

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(new List <DTO.Aircraft> {
                _plane1DTO
            }, result);
        }
Пример #4
0
        private async void LoadAircrafts()
        {
            var result = await AircraftService.GetAll();

            result.ForEach(x => Aircrafts.Add(x));
        }