예제 #1
0
        public void CreateShouldReturnWithDependenciesInitialized()
        {
            var dependencies = AuthorizationDependencies.Create(new AuthorizationOptions());

            Assert.IsInstanceOfType(dependencies.LoggerFactory, typeof(DiagnosticsLoggerFactory));
            Assert.IsInstanceOfType(dependencies.PolicyProvider, typeof(DefaultAuthorizationPolicyProvider));
            Assert.IsInstanceOfType(dependencies.Service, typeof(DefaultAuthorizationService));
        }
        public async Task IsAuthorizedAsyncShouldInitializeAuthorizationService()
        {
            var dependencies = new AuthorizationDependencies
            {
                LoggerFactory  = null,
                PolicyProvider = null,
                Service        = null
            };

            await AssertEverythingIsInitialized(dependencies);
        }
예제 #3
0
        public void CreateShouldNotReturnNull()
        {
            var dependencies = AuthorizationDependencies.Create(new AuthorizationOptions());

            Assert.IsNotNull(dependencies, "dependencies != null");
        }
예제 #4
0
 public void CreateShouldThrowWhenOptionsIsNull()
 {
     AuthorizationDependencies.Create(null);
 }
예제 #5
0
 public void CreateShouldThrowWhenHandlersIsNull()
 {
     AuthorizationDependencies.Create(new AuthorizationOptions(), null);
 }