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]);
        }
Beispiel #2
0
 internal NameValueItemCollection(NameValueItemCollection items)
 {
     foreach (NameValueItem item in items)
     {
         Add(item.Name, item.Value);
     }
 }
 internal NameValueItemCollection(NameValueItemCollection items)
 {
     foreach (NameValueItem item in items)
     {
         Add(item.Name, item.Value);
     }
 }
Beispiel #4
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]);
        }
        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"]);
        }
        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"]);
        }
 private CustomKeyAlgorithmPairStorageProviderData(string name, string typeName, NameValueItemCollection attributes)
     : base(name)
 {
     this.typeName = typeName;
     this.attributes = attributes;
 }
Beispiel #9
0
 private CustomKeyAlgorithmPairStorageProviderData(string name, string typeName, NameValueItemCollection attributes) : base(name)
 {
     this.typeName   = typeName;
     this.attributes = attributes;
 }
 /// <summary>
 /// Initializes a new instance of the 
 /// <see cref="CustomAuthorizationProviderData"/> 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 CustomAuthorizationProviderData(string name, string typeName)
     : base(name)
 {
     this.typeName = typeName;
     this.extensions = new NameValueItemCollection();
 }
Beispiel #11
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();
 }
 private CustomTransformerData(string name, string typeName, NameValueItemCollection attributes) : base(name)
 {
     this.typeName   = typeName;
     this.attributes = attributes;
 }
 private CustomTransformerData(string name, string typeName, NameValueItemCollection attributes)
     : base(name)
 {
     this.typeName = typeName;
     this.attributes = attributes;
 }
 /// <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();
 }
 /// <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();
 }
 /// <summary>
 /// Initializes a new instance of the 
 /// <see cref="CustomSecurityCacheProviderData"/> 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="ISecurityCacheProvider"/></param>
 public CustomSecurityCacheProviderData(string name, string typeName)
     : base(name)
 {
     this.typeName = typeName;
     this.extensions = new NameValueItemCollection();
 }
 /// <summary>
 /// <para>Initializes a new instance of the <see cref="CustomSymmetricCryptoProviderData"/> class with the specified name and type name.</para>
 /// </summary>
 /// <param name="name"><para>The name of the provider.</para></param>
 /// <param name="typeName"><para>The type name of a class that implements <see cref="ISymmetricCryptoProvider"/>.</para></param>
 public CustomSymmetricCryptoProviderData(string name, string typeName)
     : base(name)
 {
     this.typeName = typeName;
     this.extensions = new NameValueItemCollection();
 }