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); }
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 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(); }
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 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()); }
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); }
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 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"]); }
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); }
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); }
/// <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(); }
public MockStorageProviderData(string name, string typeName) : base(name, typeName) { this.typeName = typeName; this.attributes = new NameValueItemCollection(); }
/// <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(); }
public MockTransformerData(string name) : base(name) { this.extensions = new NameValueItemCollection(); }
/// <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(); }
/// <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(); }
public NotRealStorageProviderData(string name) : base(name) { this.extensions = new NameValueItemCollection(); }
public NotRealTransformerData(string name) : base(name) { this.extensions = new NameValueItemCollection(); }
public void SetUp() { items = new NameValueItemCollection(); }