public void MissingDefaultProviderTest()
        {
            DictionaryConfigurationSource source = new DictionaryConfigurationSource();
            source.Add(SecuritySettings.SectionName, new SecuritySettings());

            AuthorizationProviderFactory factory = new AuthorizationProviderFactory(source);
            factory.CreateDefault();
        }
		public void GetDefaultAuthorizationProviderTest()
        {
			AuthorizationProviderFactory factory = new AuthorizationProviderFactory(GetConfigurationSource());
            IAuthorizationProvider provider = factory.CreateDefault();
            Assert.IsNotNull(provider);
            MockAuthorizationProvider mockProvider = provider as MockAuthorizationProvider;
            Assert.IsNotNull(mockProvider);
            Assert.IsTrue(mockProvider.Initialized);
        }
        public void MissingDefaultProviderTest()
        {
            DictionaryConfigurationSource source = new DictionaryConfigurationSource();

            source.Add(SecuritySettings.SectionName, new SecuritySettings());

            AuthorizationProviderFactory factory = new AuthorizationProviderFactory(source);

            factory.CreateDefault();
        }
Exemple #4
0
        public void GetDefaultAuthorizationProviderTest()
        {
            AuthorizationProviderFactory factory  = new AuthorizationProviderFactory(GetConfigurationSource());
            IAuthorizationProvider       provider = factory.CreateDefault();

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

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

            if (string.IsNullOrEmpty(providerName))
            {
                return(authorizationProviderFactory.CreateDefault());
            }
            else
            {
                return(authorizationProviderFactory.Create(providerName));
            }
        }