Пример #1
0
        public void TestGetKlimatogramMetLeerlingActiefGekozenLocatieIsNotNull()
        {
            Leerling l = new Leerling();

            l.IsActief       = true;
            l.GekozenLocatie = continentRepository.GeefLocatie("Europa", "België", "Gent-Melle");//eventueel new object van locatie

            var result = controller.GetKlimatogram(l) as JsonResult;

            KlimatogramViewModel klimatogram = (KlimatogramViewModel)result.Data;

            Assert.AreEqual("Europa", klimatogram.ContinentNaam);
            Assert.AreEqual("België", klimatogram.LandNaam);
            Assert.AreEqual("Gent-Melle", klimatogram.LocatieNaam);
        }
Пример #2
0
 public ActionResult SelecteerLocatie(Leerling leerling, string continentNaam, string landNaam,
                                      string locatieNaam)
 {
     if (!leerling.IsActief)
     {
         return(RedirectToAction("Index", "Home"));
     }
     leerling.GekozenLocatie = continentRepository.GeefLocatie(continentNaam, landNaam, locatieNaam);
     //if (leerling.GekozenLocatie != null) return RedirectToAction("ToonKlimatogram");
     if (leerling.GekozenLocatie != null)
     {
         if (leerling.Graad == Graad.graad1)
         {
             return(RedirectToAction("ToonVragenEersteGraad"));
         }
         else
         {
             return(RedirectToAction("Index", "Determinatie"));
         }
     }
     return(RedirectToAction("Index"));
 }