public async void DeleteGlossaryThenSearchForIt() { var response = _service.Get("defamation"); response.Result.Records.Count.Should().Be(1); response.Result.Records.First().Term.Should().Be("defamation"); response.Result.Records.First().Text.Should().NotBeEmpty(); _service.Delete("defamation"); try { var response2 = await _service.Get("defamation"); 1.Should().Be(0); } catch (GlossaryException e) { e.Message.Should().Be("Glossary does not exist"); } }
public async Task <IActionResult> DeleteConfirmed(Guid id) { await _glossaryService.Delete(id); return(RedirectToAction(nameof(Index))); }
public ActionResult Remove(string terms) { _service.Delete(terms); return(Ok()); }