Blog.Common.Web.Tests.Attributes.PreventCrossUserManipulationTest.ShouldThrowWhenParameterUsedIsNull C# (CSharp) Method

ShouldThrowWhenParameterUsedIsNull() private method

private ShouldThrowWhenParameterUsedIsNull ( ) : void
return void
        public void ShouldThrowWhenParameterUsedIsNull()
        {
            _httpActionContext.ActionArguments.Add("dummy", null);

            var attribute = new PreventCrossUserManipulationAttribute { UsersResource = _userResource.Object };
            var result = Assert.Throws<HttpResponseException>(() => attribute.OnActionExecuting(_httpActionContext));

            Assert.AreEqual(HttpStatusCode.InternalServerError, result.Response.StatusCode);
        }