public void RequiredDefaultProviderTest()
 {
     SecurityCacheProviderCollectionNode node = new SecurityCacheProviderCollectionNode();
     CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
     ValidateNodeCommand cmd = new ValidateNodeCommand(Host);
     cmd.Execute(node);
     Assert.AreEqual(0, ValidationErrorsCount);
 }
        public void RequiredDefaultProviderTest()
        {
            SecurityCacheProviderCollectionNode node = new SecurityCacheProviderCollectionNode();

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

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

            SecurityCacheProviderCollectionNode node = new SecurityCacheProviderCollectionNode(dataCollection);
            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            Assert.AreEqual(1, node.Nodes.Count);
        }
        public void HydrateTest()
        {
            SecurityCacheProviderDataCollection dataCollection = new SecurityCacheProviderDataCollection();
            CustomSecurityCacheProviderData     providerData   = new CustomSecurityCacheProviderData();

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

            SecurityCacheProviderCollectionNode node = new SecurityCacheProviderCollectionNode(dataCollection);

            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            Assert.AreEqual(1, node.Nodes.Count);
        }
        public void GetSecurityCacheProvidersDataTest()
        {
            SecurityCacheProviderCollectionNode node = new SecurityCacheProviderCollectionNode();
            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            CustomSecurityCacheProviderNode providerNode = new CustomSecurityCacheProviderNode();
            node.Nodes.Add(providerNode);
            providerNode.Name = "provider1";
            providerNode.TypeName = typeof(MockSecurityCacheProvider).AssemblyQualifiedName;

            SecurityCacheProviderDataCollection providers = node.SecurityCacheProviderDataCollection;

            Assert.IsNotNull(providers);

            Assert.AreEqual(1, providers.Count);
            SecurityCacheProviderData data = providers["provider1"];
            Assert.IsNotNull(data);
            CustomSecurityCacheProviderData customData = data as CustomSecurityCacheProviderData;
            Assert.IsNotNull(customData);
            Assert.AreEqual(typeof(MockSecurityCacheProvider).AssemblyQualifiedName, customData.TypeName);
        }
        public void GetSecurityCacheProvidersDataTest()
        {
            SecurityCacheProviderCollectionNode node = new SecurityCacheProviderCollectionNode();

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

            node.Nodes.Add(providerNode);
            providerNode.Name     = "provider1";
            providerNode.TypeName = typeof(MockSecurityCacheProvider).AssemblyQualifiedName;

            SecurityCacheProviderDataCollection providers = node.SecurityCacheProviderDataCollection;

            Assert.IsNotNull(providers);

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

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

            Assert.IsNotNull(customData);
            Assert.AreEqual(typeof(MockSecurityCacheProvider).AssemblyQualifiedName, customData.TypeName);
        }
 public void CacheProviderCollectionNodeDefaults()
 {
     SecurityCacheProviderCollectionNode cacheProviderCollectionNode = new SecurityCacheProviderCollectionNode();
     Assert.AreEqual("Security Cache", cacheProviderCollectionNode.Name);
 }
예제 #8
0
        public void CacheProviderCollectionNodeDefaults()
        {
            SecurityCacheProviderCollectionNode cacheProviderCollectionNode = new SecurityCacheProviderCollectionNode();

            Assert.AreEqual("Security Cache", cacheProviderCollectionNode.Name);
        }