public void AuthorizeCore_userIsNotAuthenticated_shouldAllowAccess()
        {
            // Arrange
            var helper = new AuthorizeAttributeHelper();
            var request = new Mock<HttpRequestBase>();
            var mockHttpContext = new Mock<HttpContextBase>();
            mockHttpContext.Setup(ctx => ctx.User.Identity).Returns(CreateClaimsIdentityMock(CreateClaims(), false).Object);
            mockHttpContext.Setup(ctx => ctx.Request).Returns(request.Object);

            // Act
            var retVal = helper.PublicAuthorizeCore(mockHttpContext.Object);

            // Assert
            Assert.IsTrue(retVal);
        }
        public void AuthorizeCore_requiredRequestParameterMissing_shouldDenyAccess()
        {
            // Arrange
            var helper = new AuthorizeAttributeHelper();
            var request = new Mock<HttpRequestBase>();
            var mockHttpContext = new Mock<HttpContextBase>();
            mockHttpContext.Setup(ctx => ctx.User.Identity).Returns(CreateClaimsIdentityMock(CreateClaims(), true).Object);
            mockHttpContext.Setup(ctx => ctx.Request).Returns(request.Object);

            // Act
            var retVal = helper.PublicAuthorizeCore(mockHttpContext.Object);

            // Assert
            Assert.IsFalse(retVal);
        }