public void ThatUnitGroupIsStillThereAfterUnitDelete() { var unit = UnitServices.WithDto(GetUnitDto()).Get(); UnitServices.Delete(unit); Assert.IsNotNull(UnitGroupServices.UnitGroups.SingleOrDefault(x => x.Name == GetUnitDto().UnitGroupName)); }
public void ThatServicesCanDeleteUnit() { var unit = UnitServices.WithDto(GetUnitDto()).Get(); UnitServices.Delete(unit); Assert.IsNull(UnitServices.Units.SingleOrDefault(x => x.Name == GetUnitDto().Name)); }
public ActionResult DeleteConfirmed(int id) { if (ModelState.IsValid) { try { unitService.Delete(id); return(RedirectToAction("Index")); } catch { return(View()); } } return(View()); }
public void DeleteUnit(Unit unit) { UnitServices.Delete(unit); SearchUnit(); }