Exemple #1
0
        public void FactoryTest()
        {
            AuthorizationProviderFactory factory      = new AuthorizationProviderFactory(ConfigurationSourceFactory.Create());
            IAuthorizationProvider       ruleProvider = factory.Create("RuleProvider");

            Assert.IsTrue(ruleProvider.Authorize(principal, testRuleName));
        }
		public void GetAuthorizationProviderByNameTest()
        {
			AuthorizationProviderFactory factory = new AuthorizationProviderFactory(GetConfigurationSource());
			IAuthorizationProvider provider = factory.Create("provider1");
            Assert.IsNotNull(provider);
			MockAuthorizationProvider mockProvider = provider as MockAuthorizationProvider;
			Assert.IsNotNull(mockProvider);
        }
Exemple #3
0
        public void GetAuthorizationProviderByNameTest()
        {
            AuthorizationProviderFactory factory  = new AuthorizationProviderFactory(GetConfigurationSource());
            IAuthorizationProvider       provider = factory.Create("provider1");

            Assert.IsNotNull(provider);
            MockAuthorizationProvider mockProvider = provider as MockAuthorizationProvider;

            Assert.IsNotNull(mockProvider);
        }
Exemple #4
0
        private IAuthorizationProvider GetAuthorizationProvider()
        {
            AuthorizationProviderFactory authorizationProviderFactory = new AuthorizationProviderFactory(configurationSource);

            if (string.IsNullOrEmpty(providerName))
            {
                return(authorizationProviderFactory.CreateDefault());
            }
            else
            {
                return(authorizationProviderFactory.Create(providerName));
            }
        }
		public void AuthorizationProviderNotFoundTest()
        {
			AuthorizationProviderFactory factory = new AuthorizationProviderFactory(GetConfigurationSource());
			factory.Create("provider3");
        }
Exemple #6
0
        public void AuthorizationProviderNotFoundTest()
        {
            AuthorizationProviderFactory factory = new AuthorizationProviderFactory(GetConfigurationSource());

            factory.Create("provider3");
        }
        public void MissingSecuritySectionTest()
        {
            AuthorizationProviderFactory factory = new AuthorizationProviderFactory(new DictionaryConfigurationSource());

            factory.Create("provider3");
        }
		public void FactoryTest()
		{
			AuthorizationProviderFactory factory = new AuthorizationProviderFactory(ConfigurationSourceFactory.Create());
			IAuthorizationProvider ruleProvider = factory.Create("RuleProvider");
			Assert.IsTrue(ruleProvider.Authorize(principal, testRuleName));
		}
 public void MissingSecuritySectionTest()
 {
     AuthorizationProviderFactory factory = new AuthorizationProviderFactory(new DictionaryConfigurationSource());
     factory.Create("provider3");
 }