Exemplo n.º 1
0
        public async Task ValidateHandleAsync_Failed()
        {
            // Arrange
            this.memberValidationService
            .Setup(svc => svc.ValidateMemberAsync(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>()))
            .ReturnsAsync(() => false);

            this.authContext = FakeHttpContext.GetAuthorizationHandlerContextForTeacherOrAdmin();

            // Act
            await this.policyHandler.HandleAsync(this.authContext);

            // Assert
            Assert.IsFalse(this.authContext.HasSucceeded);
        }