public async Task DeleteWithNullOrMissingIdReturnsNotFound(int?id) { IActionResult result = await _controller.Delete(id); Assert.That(result, Is.Not.Null); Assert.That(result, Is.TypeOf <NotFoundResult>()); }
public ActionResult Delete(FormCollection _form) { IdeasController nc = new IdeasController(Server); return((ActionResult)nc.Delete(Request)["view"]); //return null; }
public async Task Delete_ShouldDeleteIdea() { // Arrange Functions.AddMockIdentityToContext(_ideasController, "*****@*****.**"); // Act var result = await _ideasController.Delete("abcdef"); // Assert Assert.NotNull(result); var noContentResult = result as NoContentResult; Assert.NotNull(noContentResult); Assert.Equal(204, noContentResult.StatusCode); }