public void DeleteFalseInput() { EmptyLists(); treatmentTypeRepository = new TreatmentTypeRepository(context); Exception ex = Assert.Throws <NullReferenceException>(() => treatmentTypeRepository.Delete(-1)); Assert.Equal("Het behandelingsTypeId is leeg.", ex.Message); }
/// <summary> /// Passes the requested through to delete the treatmentType /// </summary> /// <param name="id"> Id of an TreatmentType</param> /// <returns> Send the user back to the page with all treatmentTypes</returns> public IActionResult Delete(long id) { // Check if is valid if (ModelState.IsValid) { // Delete treatmenttype repository.Delete(id); } return(RedirectToAction("index")); }
public void Delete() { EmptyLists(); treatmentTypeRepository = new TreatmentTypeRepository(context); Assert.True(treatmentTypeRepository.Delete(9)); }