예제 #1
0
        public void CustomNodeTest()
        {
            string name = "testName";
            string type = "testType";
            NameValueItemCollection extensions = new NameValueItemCollection();

            extensions.Add(new NameValueItem("test", "value"));

            CustomCacheStorageNode node = new CustomCacheStorageNode();

            applicationNode.Nodes.Add(node);
            Assert.AreEqual(SR.DefaultCacheStorageNodeName, node.Name);

            node.Type = type;
            Assert.AreEqual(type, node.Type);

            node.Name = name;
            Assert.AreEqual(name, node.Name);

            node.Extensions.Add(extensions[0]);
            Assert.AreEqual(extensions[0], node.Extensions[0]);

            CustomCacheStorageData nodeData = (CustomCacheStorageData)node.CacheStorageData;

            Assert.AreEqual(name, nodeData.Name);
            Assert.AreEqual(type, nodeData.TypeName);
            Assert.AreEqual(extensions[0], nodeData.Extensions[0]);
        }
        public void CanAddConfigSectionToCollection()
        {
            NameValueItem nameValueItem = new NameValueItem();
            nameValueItem.Name = "Bill";
            NameValueItemCollection collection = new NameValueItemCollection();
            collection.Add(nameValueItem);

            Assert.AreEqual(1, collection.Count);
        }
예제 #3
0
        public void ClearTest()
        {
            NameValueItemCollection collection = new NameValueItemCollection();

            collection.Add("key1", "value1");
            collection.Add("key2", "value2");
            Assert.AreEqual(2, collection.Count);
            collection.Clear();
            Assert.AreEqual(0, collection.Count);
        }
예제 #4
0
        public static IQueryable<NameValueItem> GetRoleList()
        {
            var result = new NameValueItemCollection();

            result.Add((int)Role.None, "None");
            result.Add((int)Role.Contribute, "Contribute");
            result.Add((int)Role.FullControl, "Full Control");
            result.Add((int)Role.Review, "Review");

            return result.AsQueryable();
        }
예제 #5
0
        public void CanAddConfigSectionToCollection()
        {
            NameValueItem nameValueItem = new NameValueItem();

            nameValueItem.Name = "Bill";
            NameValueItemCollection collection = new NameValueItemCollection();

            collection.Add(nameValueItem);

            Assert.AreEqual(1, collection.Count);
        }
예제 #6
0
        public void CustomFormatterDataPropertiesTest()
        {
            CustomFormatterData     data       = new CustomFormatterData();
            NameValueItemCollection attributes = new NameValueItemCollection();

            attributes.Add(new NameValueItem("TEST", "test"));

            data.Attributes.Add(attributes[0]);

            Assert.AreEqual(attributes[0], data.Attributes[0]);
        }
예제 #7
0
        public static IQueryable <NameValueItem> GetRoleList()
        {
            var result = new NameValueItemCollection();

            result.Add((int)Role.None, "None");
            result.Add((int)Role.Contribute, "Contribute");
            result.Add((int)Role.FullControl, "Full Control");
            result.Add((int)Role.Review, "Review");

            return(result.AsQueryable());
        }
예제 #8
0
        public void IndexerIntOutOfRangeTest()
        {
            NameValueItem nameValueItem = new NameValueItem();

            nameValueItem.Name = "Bill";
            NameValueItemCollection collection = new NameValueItemCollection();

            collection.Add(nameValueItem);
            NameValueItem billSection = collection[1];

            Assert.AreSame(nameValueItem, billSection);
        }
예제 #9
0
        public void IndexerTest()
        {
            NameValueItem nameValueItem = new NameValueItem();

            nameValueItem.Name = "Bill";
            NameValueItemCollection collection = new NameValueItemCollection();

            collection.Add(nameValueItem);
            NameValueItem billSection = collection.GetNameValueItem("Bill");

            Assert.AreSame(nameValueItem, billSection);
        }
예제 #10
0
        public void CanGetFirstElementFromCollection()
        {
            NameValueItem nameValueItem = new NameValueItem();

            nameValueItem.Name = "Bill";
            NameValueItemCollection collection = new NameValueItemCollection();

            collection.Add(nameValueItem);

            IEnumerator enumerator = collection.GetEnumerator();

            enumerator.MoveNext();
            Assert.AreEqual("Bill", ((NameValueItem)enumerator.Current).Name);
        }
        public void CustomHandlerPropertiesTest()
        {
            string typeName = "testType";
            NameValueItemCollection attributes = new NameValueItemCollection();

            attributes.Add(new NameValueItem("NAME", "VALUE"));

            CustomHandlerNode node = new CustomHandlerNode();

            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            node.TypeName = typeName;
            node.Attributes.Add(attributes[0]);

            Assert.AreEqual(typeName, node.TypeName);
            Assert.AreEqual(attributes["NAME"], node.Attributes["NAME"]);
        }
예제 #12
0
        public void CanAddTwoConfigSectionsToCollection()
        {
            NameValueItem sectionOne = new NameValueItem();

            sectionOne.Name = "SectionOne";

            NameValueItem sectionTwo = new NameValueItem();

            sectionTwo.Name = "SectionTwo";

            NameValueItemCollection collection = new NameValueItemCollection();

            collection.Add(sectionOne);
            collection.Add(sectionTwo);

            Assert.AreEqual(2, collection.Count);
        }
예제 #13
0
        public void CustomHandlerPropertiesTest()
        {
            CustomHandlerData       data       = new CustomHandlerData();
            string                  name       = "Test Name";
            string                  typeName   = "Test TypeName";
            NameValueItemCollection attributes = new NameValueItemCollection();

            attributes.Add(new NameValueItem("TEST", "VALUE"));

            data.Name     = name;
            data.TypeName = typeName;
            data.Attributes.Add(attributes[0]);

            Assert.AreEqual(name, data.Name);
            Assert.AreEqual(typeName, data.TypeName);
            Assert.AreEqual(attributes["TEST"], data.Attributes["TEST"]);
        }
        public void CustomHandlerGetDataTest()
        {
            CustomHandlerData       data       = new CustomHandlerData();
            string                  typeName   = "TestType";
            string                  name       = "TestName";
            NameValueItemCollection attributes = new NameValueItemCollection();

            attributes.Add(new NameValueItem("NAME", "VALUE"));

            data.TypeName = typeName;
            data.Name     = name;
            data.Attributes.Add(attributes[0]);

            CustomHandlerNode node = new CustomHandlerNode(data);

            CreateHierarchyAndAddToHierarchyService(node, CreateDefaultConfiguration());
            CustomHandlerData nodeData = (CustomHandlerData)node.ExceptionHandlerData;

            Assert.AreEqual(typeName, nodeData.TypeName);
            Assert.AreEqual(name, nodeData.Name);
            Assert.AreEqual(attributes["NAME"], nodeData.Attributes["NAME"]);
        }
 public void CollectionHoldsZeroElementsAtCreation()
 {
     NameValueItemCollection collection = new NameValueItemCollection();
     Assert.AreEqual(0, collection.Count);
 }
예제 #16
0
        public void CollectionHoldsZeroElementsAtCreation()
        {
            NameValueItemCollection collection = new NameValueItemCollection();

            Assert.AreEqual(0, collection.Count);
        }
예제 #17
0
 /// <summary>
 /// Initialize a new instance of the <see cref="CustomDistributionStrategyData"/> class with a name.
 /// </summary>
 /// <param name="name">
 /// The name of the strategy data.
 /// </param>
 /// <param name="typeName">
 /// The type name of the provider.
 /// </param>
 public CustomDistributionStrategyData(string name, string typeName) : base(name)
 {
     this.typeName = typeName;
     attributes    = new NameValueItemCollection();
 }
예제 #18
0
 public MockStorageProviderData(string name, string typeName) : base(name, typeName)
 {
     this.typeName   = typeName;
     this.attributes = new NameValueItemCollection();
 }
예제 #19
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="CustomProfileProviderData"/> class with
 /// the specified name and type name.
 /// </summary>
 /// <param name="name">The name of the provider.</param>
 /// <param name="typeName">The type name of a class that implements <see cref="IAuthorizationProvider"/></param>
 public CustomProfileProviderData(string name, string typeName) : base(name)
 {
     this.typeName   = typeName;
     this.extensions = new NameValueItemCollection();
 }
 public ExceptionConstructorStorageProviderData(string name)
     : base(name)
 {
     this.extensions = new NameValueItemCollection();
 }
예제 #21
0
 public MockTransformerData(string name)
     : base(name)
 {
     this.extensions = new NameValueItemCollection();
 }
예제 #22
0
 /// <summary>
 /// Initialize a new instance of the <see cref="CustomFormatterData"/> class with a name and type.
 /// </summary>
 /// <param name="name">
 /// The name of the formatter.
 /// </param>
 /// <param name="typeName">
 /// The type name to use as the custom formatter.
 /// </param>
 public CustomFormatterData(string name, string typeName) : base(name)
 {
     this.typeName = typeName;
     attributes    = new NameValueItemCollection();
 }
예제 #23
0
 /// <summary>
 /// Initialize a new instance of the <see cref="CacheManagerData"/> class.
 /// </summary>
 /// <param name="name">
 /// The name of the <see cref="CacheManagerData"/>.
 /// </param>
 /// <param name="typeName">
 /// Gets the type for the <see cref="CustomCacheStorageData"/>.
 /// </param>
 /// <param name="storageEncryption">
 /// Storage Encryption data defined in configuration
 /// </param>
 public CustomCacheStorageData(string name, string typeName, StorageEncryptionProviderData storageEncryption) : base(name, storageEncryption)
 {
     this.typeName   = typeName;
     this.extensions = new NameValueItemCollection();
 }
예제 #24
0
 public MockStorageProviderData(string name, string typeName)
     : base(name, typeName)
 {
     this.typeName = typeName;
     this.attributes = new NameValueItemCollection();
 }
예제 #25
0
 public NotRealStorageProviderData(string name) : base(name)
 {
     this.extensions = new NameValueItemCollection();
 }
예제 #26
0
 public NotRealTransformerData(string name) : base(name)
 {
     this.extensions = new NameValueItemCollection();
 }
 public void ClearTest()
 {
     NameValueItemCollection collection = new NameValueItemCollection();
     collection.Add("key1", "value1");
     collection.Add("key2", "value2");
     Assert.AreEqual(2, collection.Count);
     collection.Clear();
     Assert.AreEqual(0, collection.Count);
 }
        public void CanGetFirstElementFromCollection()
        {
            NameValueItem nameValueItem = new NameValueItem();
            nameValueItem.Name = "Bill";
            NameValueItemCollection collection = new NameValueItemCollection();
            collection.Add(nameValueItem);

            IEnumerator enumerator = collection.GetEnumerator();
            enumerator.MoveNext();
            Assert.AreEqual("Bill", ((NameValueItem)enumerator.Current).Name);
        }
 public void SetUp()
 {
     items = new NameValueItemCollection();
 }
예제 #30
0
 public ExceptionConstructorStorageProviderData(string name) : base(name)
 {
     this.extensions = new NameValueItemCollection();
 }
 public void IndexerTest()
 {
     NameValueItem nameValueItem = new NameValueItem();
     nameValueItem.Name = "Bill";
     NameValueItemCollection collection = new NameValueItemCollection();
     collection.Add(nameValueItem);
     NameValueItem billSection = collection.GetNameValueItem("Bill");
     Assert.AreSame(nameValueItem, billSection);
 }
 public void IndexerIntOutOfRangeTest()
 {
     NameValueItem nameValueItem = new NameValueItem();
     nameValueItem.Name = "Bill";
     NameValueItemCollection collection = new NameValueItemCollection();
     collection.Add(nameValueItem);
     NameValueItem billSection = collection[1];
     Assert.AreSame(nameValueItem, billSection);
 }
예제 #33
0
 public void SetUp()
 {
     items = new NameValueItemCollection();
 }
예제 #34
0
 public NotRealStorageProviderData(string name)
     : base(name)
 {
     this.extensions = new NameValueItemCollection();
 }
        public void CanAddTwoConfigSectionsToCollection()
        {
            NameValueItem sectionOne = new NameValueItem();
            sectionOne.Name = "SectionOne";

            NameValueItem sectionTwo = new NameValueItem();
            sectionTwo.Name = "SectionTwo";

            NameValueItemCollection collection = new NameValueItemCollection();
            collection.Add(sectionOne);
            collection.Add(sectionTwo);

            Assert.AreEqual(2, collection.Count);
        }