Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public void CreateShouldNotReturnNull()
        {
            var dependencies = AuthorizationDependencies.Create(new AuthorizationOptions());

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