private ShouldReturnUnauthorizedWhenNotAuthenticated ( ) : void | ||
Результат | void |
public void ShouldReturnUnauthorizedWhenNotAuthenticated()
{
_requestBase.SetupGet(r => r.IsAuthenticated).Returns(false);
var attribute = new BlogAuthorizationAttribute();
attribute.OnAuthentication(_authenticationContext.Object);
Assert.IsInstanceOf(typeof(HttpUnauthorizedResult), _authenticationContext.Object.Result);
}