コード例 #1
0
 public void CreateCrisisContactSuccessfulTest()
 {
     using (ShimsContext.Create())
     {
         sampleDisplay.ID = 0;
         ShimCrisisContactRepo.AllInstances.CreateCrisisContactCrisisContact = (repo, contact) => 1;
         var result = target.CreateCrisisContact(sampleDisplay);
         Assert.AreEqual(1, result);
     }
 }
コード例 #2
0
 public ActionResult Create(CrisisContactDisplay crisisContact)
 {
     if (logics.CreateCrisisContact(crisisContact) != null)
     {
         this.TempData["Info"] = $"The crisis contact {crisisContact.Name} was created succesfully.";
         return(this.RedirectToAction("Index"));
     }
     else
     {
         this.TempData["Error"] = $"The crisis contact {crisisContact.Name} was not created.";
         return(this.View(crisisContact));
     }
 }