Esempio n. 1
0
        public ActionResult LoadDetails(int id)
        {
            var model = new AircraftViewModel();

            model = _actypeService.GetAll().Where(x => x.ID == id).FirstOrDefault();
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public ActionResult Calendar()
        {
            var users = _userService.GetAll();
            CalendarViewModel model = new CalendarViewModel();

            model.Aircrafts    = _actypeService.GetAll().ToList();
            model.Pilots       = users.Where(x => x.RoleID == (int)UserRole.Pilot).ToList();
            model.Crews        = users.Where(x => x.RoleID == (int)UserRole.AircraftCrew).ToList();
            model.Destinations = _destService.GetAll().ToList();
            //model.Aircrafts =
            return(View(model));
        }
        public void GetDetails_Should_ReturnAircraftType_When_Called()
        {
            var type   = _aircraftTypeService.GetAll().First();
            var result = _aircraftTypeService.GetDetails(type.Id);

            Assert.AreEqual(type.Id, result.Id);
        }
        public ActionResult Index()
        {
            RegistrationViewModel model = new RegistrationViewModel();

            model.Aircrafts = _actypeService.GetAll().ToList();

            return(View(model));
        }
        public void GetAll_Should_ReturnListAircraftTypeDTO_When_Called()
        {
            A.CallTo(() => _fakeMapper.Map <List <AircraftType>, List <DTO.AircraftType> >(A <List <AircraftType> > .That.Contains(_type1)))
            .Returns(new List <DTO.AircraftType> {
                _type1DTO
            });
            A.CallTo(() => _fakeUnitOfWork.Set <AircraftType>().Get(null)).Returns(new List <AircraftType> {
                _type1
            });
            List <DTO.AircraftType> result = _aircraftTypeService.GetAll();

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(new List <DTO.AircraftType> {
                _type1DTO
            }, result);
        }