public void SerializationTest()
        {
            RolesProviderDataCollection collection =
                new RolesProviderDataCollection();

            Utility.SerializationTest(collection);
        }
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="RolesProviderCollectionNode"/>
 /// class from the specified data.
 /// </summary>
 /// <param name="rolesProviderDataCollection">The configuration data for an Roles provider collection.</param>
 public RolesProviderCollectionNode(RolesProviderDataCollection rolesProviderDataCollection) : base()
 {
     if (rolesProviderDataCollection == null)
     {
         throw new ArgumentNullException("rolesProviderDataCollection");
     }
     this.rolesProviderDataCollection = rolesProviderDataCollection;
 }
 /// <summary>
 /// Initializes a new instance of the 
 /// <see cref="RolesProviderCollectionNode"/>
 /// class from the specified data.
 /// </summary>
 /// <param name="rolesProviderDataCollection">The configuration data for an Roles provider collection.</param>
 public RolesProviderCollectionNode(RolesProviderDataCollection rolesProviderDataCollection)
     : base()
 {
     if (rolesProviderDataCollection == null)
     {
         throw new ArgumentNullException("rolesProviderDataCollection");
     }
     this.rolesProviderDataCollection = rolesProviderDataCollection;
 }
 public void AddTest()
 {
     RolesProviderDataCollection collection =
         new RolesProviderDataCollection();
     Assert.AreEqual(0, collection.Count);
     MockRolesProviderData providerData =
         new MockRolesProviderData();
     providerData.Name = "provider1";
     collection.Add(providerData);
     Assert.AreEqual(1, collection.Count);
 }
        public void HydrateTest()
        {
            RolesProviderDataCollection dataCollection = new RolesProviderDataCollection();
            CustomRolesProviderData providerData = new CustomRolesProviderData();
            providerData.Name = "provider1";
            providerData.TypeName = typeof(MockRolesProvider).AssemblyQualifiedName;
            dataCollection.Add(providerData);

            RolesProviderCollectionNode node = new RolesProviderCollectionNode(dataCollection);
            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            Assert.AreEqual(1, node.Nodes.Count);
        }
 public void IndexerTest()
 {
     RolesProviderDataCollection collection =
         new RolesProviderDataCollection();
     MockRolesProviderData providerData =
         new MockRolesProviderData();
     providerData.Name = "provider1";
     collection[providerData.Name] = providerData;
     Assert.AreEqual(1, collection.Count);
     RolesProviderData compareData =
         collection["provider1"];
     Assert.AreSame(providerData, compareData);
 }
        public void AddTest()
        {
            RolesProviderDataCollection collection =
                new RolesProviderDataCollection();

            Assert.AreEqual(0, collection.Count);
            MockRolesProviderData providerData =
                new MockRolesProviderData();

            providerData.Name = "provider1";
            collection.Add(providerData);
            Assert.AreEqual(1, collection.Count);
        }
示例#8
0
        public void HydrateTest()
        {
            RolesProviderDataCollection dataCollection = new RolesProviderDataCollection();
            CustomRolesProviderData     providerData   = new CustomRolesProviderData();

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

            RolesProviderCollectionNode node = new RolesProviderCollectionNode(dataCollection);

            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            Assert.AreEqual(1, node.Nodes.Count);
        }
        public void IndexerTest()
        {
            RolesProviderDataCollection collection =
                new RolesProviderDataCollection();
            MockRolesProviderData providerData =
                new MockRolesProviderData();

            providerData.Name             = "provider1";
            collection[providerData.Name] = providerData;
            Assert.AreEqual(1, collection.Count);
            RolesProviderData compareData =
                collection["provider1"];

            Assert.AreSame(providerData, compareData);
        }
示例#10
0
        public void GetRolesDataTest()
        {
            RolesProviderCollectionNode node = new RolesProviderCollectionNode();

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

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

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

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

            Assert.IsNotNull(customData);
            Assert.AreEqual(typeof(MockRolesProvider).AssemblyQualifiedName, customData.TypeName);
        }
 public void SerializationTest()
 {
     RolesProviderDataCollection collection =
         new RolesProviderDataCollection();
     Utility.SerializationTest(collection);
 }