public void NotRequiredDefaultProviderTest()
 {
     AuthorizationProviderCollectionNode node = new AuthorizationProviderCollectionNode();
     CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
     ValidateNodeCommand cmd = new ValidateNodeCommand(Host);
     cmd.Execute(node);
     Assert.AreEqual(0, ValidationErrorsCount);
 }
예제 #2
0
        public void NotRequiredDefaultProviderTest()
        {
            AuthorizationProviderCollectionNode node = new AuthorizationProviderCollectionNode();

            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            ValidateNodeCommand cmd = new ValidateNodeCommand(Host);

            cmd.Execute(node);
            Assert.AreEqual(0, ValidationErrorsCount);
        }
        public void HydrateTest()
        {
            AuthorizationProviderDataCollection dataCollection = new AuthorizationProviderDataCollection();
            CustomAuthorizationProviderData providerData = new CustomAuthorizationProviderData();
            providerData.Name = "provider1";
            providerData.TypeName = typeof(MockAuthorizationProvider).AssemblyQualifiedName;
            dataCollection.Add(providerData);

            AuthorizationProviderCollectionNode node = new AuthorizationProviderCollectionNode(dataCollection);
            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            Assert.AreEqual(1, node.Nodes.Count);
        }
예제 #4
0
        public void HydrateTest()
        {
            AuthorizationProviderDataCollection dataCollection = new AuthorizationProviderDataCollection();
            CustomAuthorizationProviderData     providerData   = new CustomAuthorizationProviderData();

            providerData.Name     = "provider1";
            providerData.TypeName = typeof(MockAuthorizationProvider).AssemblyQualifiedName;
            dataCollection.Add(providerData);

            AuthorizationProviderCollectionNode node = new AuthorizationProviderCollectionNode(dataCollection);

            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            Assert.AreEqual(1, node.Nodes.Count);
        }
 public void GetAuthorizationDataTest()
 {
     AuthorizationProviderCollectionNode node = new AuthorizationProviderCollectionNode();
     CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
     CustomAuthorizationProviderNode providerNode = new CustomAuthorizationProviderNode();
     node.Nodes.Add(providerNode);
     providerNode.Name = "provider1";
     providerNode.TypeName = typeof(MockAuthorizationProvider).AssemblyQualifiedName;
     AuthorizationProviderDataCollection providers = node.AuthorizationProviderDataCollection;
     Assert.IsNotNull(providers);
     Assert.AreEqual(1, providers.Count);
     AuthorizationProviderData data = providers["provider1"];
     Assert.IsNotNull(data);
     CustomAuthorizationProviderData customData = data as CustomAuthorizationProviderData;
     Assert.IsNotNull(customData);
     Assert.AreEqual(typeof(MockAuthorizationProvider).AssemblyQualifiedName, customData.TypeName);
 }
예제 #6
0
        public void GetAuthorizationDataTest()
        {
            AuthorizationProviderCollectionNode node = new AuthorizationProviderCollectionNode();

            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            CustomAuthorizationProviderNode providerNode = new CustomAuthorizationProviderNode();

            node.Nodes.Add(providerNode);
            providerNode.Name     = "provider1";
            providerNode.TypeName = typeof(MockAuthorizationProvider).AssemblyQualifiedName;
            AuthorizationProviderDataCollection providers = node.AuthorizationProviderDataCollection;

            Assert.IsNotNull(providers);
            Assert.AreEqual(1, providers.Count);
            AuthorizationProviderData data = providers["provider1"];

            Assert.IsNotNull(data);
            CustomAuthorizationProviderData customData = data as CustomAuthorizationProviderData;

            Assert.IsNotNull(customData);
            Assert.AreEqual(typeof(MockAuthorizationProvider).AssemblyQualifiedName, customData.TypeName);
        }
 public void AuthorizationProviderCollectionDefaults()
 {
     AuthorizationProviderCollectionNode authProviderCollection = new AuthorizationProviderCollectionNode();
     Assert.AreEqual("Authorization", authProviderCollection.Name);
 }
        public void AuthorizationProviderCollectionDefaults()
        {
            AuthorizationProviderCollectionNode authProviderCollection = new AuthorizationProviderCollectionNode();

            Assert.AreEqual("Authorization", authProviderCollection.Name);
        }