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

ShouldThrowWhenUserPropertyIsEmptyInParameter() private method

private ShouldThrowWhenUserPropertyIsEmptyInParameter ( ) : void
return void
        public void ShouldThrowWhenUserPropertyIsEmptyInParameter()
        {
            _httpActionContext.ActionArguments.Add("dummy", new DummyObject { Name = "foo" });

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

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