Exemplo n.º 1
0
        public void SpeciesValidationOnCreate()
        {
            //Checking property validation for a new Treatment object, should pass when the properties aren't empty
            CheckPropertyValidation cpv = new CheckPropertyValidation();
            var species = new Models.Species
            {
                Name = "Hund",
            };
            var errorcount = cpv.myValidation(species).Count();

            Assert.AreEqual(0, errorcount);
        }
Exemplo n.º 2
0
 public IActionResult OnGet(int?id)
 {
     SpeciesObj = new Models.Species();
     if (id != null)
     {
         SpeciesObj = _unitOfWork.Species.GetFirstOrDefault(u => u.Id == id);
         if (SpeciesObj == null)
         {
             return(NotFound());
         }
     }
     return(Page());
 }