OnAuthentication() публичный Метод

public OnAuthentication ( System.Web.Http.Filters.HttpAuthenticationContext context ) : void
context System.Web.Http.Filters.HttpAuthenticationContext
Результат void
        public void ShouldReturnUnauthorizedWhenNotAuthenticated()
        {
            _principal.SetupGet(x => x.Identity.IsAuthenticated).Returns(false);
            _principal.SetupGet(x => x.Identity.Name).Returns("foo");
            var httpAuthenticationContext = new HttpAuthenticationContext(_httpActionContext, _principal.Object);

            var attribute = new BlogApiAuthorizationAttribute();
            attribute.OnAuthentication(httpAuthenticationContext);

            Assert.IsNotNull(httpAuthenticationContext.ErrorResult);
        }