public async Task Test_Delete_Id_Action_OfType_TestModel() { var controller = new CommandController <int, TestModel>(mediator); var action_payload = new TestModel { Id = 1 }; var current_result = await controller.Delete(action_payload.Id); var result_as_noContentResult = ((NoContentResult)current_result); // testing action return type Assert.IsInstanceOfType(current_result, typeof(NoContentResult)); // or simply Assert.IsTrue(current_result is IActionResult); // testing status code Assert.IsTrue(result_as_noContentResult.StatusCode == 204); }