Ejemplo n.º 1
0
        public AdminBootcampTechnologyViewModel Get()
        {
            AdminBootcampTechnologyViewModel model = new AdminBootcampTechnologyViewModel();

            //get all bootcamp technologies, and convert each to correct format
            //before adding each to the angular view model
            foreach (BootcampTechnology technology in _bootcampTechRepo.GetAllBootcampTechnologies())
            {
                BootcampTechnologyAng item = new BootcampTechnologyAng
                {
                    BootcampTechnologyId = technology.BootcampTechnologyID,
                    BootcampName         = _bootcampRepo.GetBootcampByID(technology.BootcampID.Value).Name,
                    Technology           = _techRepo.GetTechnologyById(technology.TechnologyID.Value).Name
                };
                model.BootcampTechnologies.Add(item);
            }

            //get all bootcamps (name and id) and add to the model
            foreach (Bootcamp bootcamp in _bootcampRepo.GetAllBootcamps())
            {
                BootcampAng ang2 = new BootcampAng
                {
                    BootcampID = bootcamp.BootcampID,
                    Name       = bootcamp.Name
                };
                model.Bootcamps.Add(ang2);
            }

            //get all technologies (name and id) and add to the view model
            foreach (Technology technology2 in _techRepo.GetAllTechnologies())
            {
                TechnologyAng ang3 = new TechnologyAng
                {
                    TechnologyId = technology2.TechnologyID,
                    Name         = technology2.Name
                };
                model.Technologies.Add(ang3);
            }
            return(model);
        }
Ejemplo n.º 2
0
 public void GetAllBootcampTechnologiesTest()
 {
     Assert.AreEqual(repo.GetAllBootcampTechnologies().Count, 2);
 }