Пример #1
0
 public virtual ActionResult Create(AddIndexViewModel indexViewModel)
 {
     if (ModelState.IsValid)
     {
         _applicationService.AddIndex(indexViewModel.ApplicaitonId, indexViewModel.Name, indexViewModel.ArchiveName, indexViewModel.ArchiveColumn);
     }
     else
     {
         TempData["comment"] = "Required files are missing";
     }
     return(new RedirectResult(Request.Headers["Referer"]));
 }
 public void GivenAValidApplication_WhenIAddAnIndex_AndTheDatabaseIsNotAvailable_ThenAnUnityExceptionIsThrown()
 {
     _applicationRepository.Setup(p => p.AddIndex(It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())).Throws
     <Exception>();
     Assert.Throws <UnityException>(() => _applicationService.AddIndex(1, "name", "archiveName", "archiveValue"));
 }