Blog.Common.Web.Tests.Attributes.BlogApiAuthorizationAttributeTest.ShouldSuccessfullyAuthenticate C# (CSharp) Метод

ShouldSuccessfullyAuthenticate() приватный Метод

private ShouldSuccessfullyAuthenticate ( ) : void
Результат void
        public void ShouldSuccessfullyAuthenticate()
        {
            _principal.SetupGet(x => x.Identity.IsAuthenticated).Returns(true);
            _principal.SetupGet(x => x.Identity.Name).Returns("foo");
            var httpAuthenticationContext = new HttpAuthenticationContext(_httpActionContext, _principal.Object);

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

            Assert.IsNull(httpAuthenticationContext.ErrorResult);
        }