Esempio n. 1
0
        public async Task DeleteWithNullOrMissingIdReturnsNotFound(int?id)
        {
            IActionResult result = await _controller.Delete(id);

            Assert.That(result, Is.Not.Null);
            Assert.That(result, Is.TypeOf <NotFoundResult>());
        }
Esempio n. 2
0
        public ActionResult Delete(FormCollection _form)
        {
            IdeasController nc = new IdeasController(Server);

            return((ActionResult)nc.Delete(Request)["view"]);
            //return null;
        }
Esempio n. 3
0
        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);
        }