Exemplo n.º 1
0
        public void CustomHandlerNodeDefaults()
        {
            CustomHandlerNode customHandler = new CustomHandlerNode();

            Assert.AreEqual(0, customHandler.Attributes.Count);
            Assert.AreEqual("Custom Handler", customHandler.Name);
            Assert.IsTrue(string.IsNullOrEmpty(customHandler.Type));
        }
        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()
        {
            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"]);
        }
Exemplo n.º 4
0
        public void CustomHandlerDataTest()
        {
            string            attributeKey   = "attKey";
            string            attributeValue = "attValue";
            string            name           = "some name";
            Type              type           = typeof(WrapHandlerNode);
            CustomHandlerData data           = new CustomHandlerData();

            data.Name = name;
            data.Type = type;
            data.Attributes.Add(attributeKey, attributeValue);
            CustomHandlerNode node = new CustomHandlerNode(data);

            Assert.AreEqual(name, node.Name);
            Assert.AreEqual(type.AssemblyQualifiedName, node.Type);
            Assert.AreEqual(attributeKey, node.Attributes[0].Key);
            Assert.AreEqual(attributeValue, node.Attributes[0].Value);
        }
Exemplo n.º 5
0
        public void CustomHandlerNodeDataTest()
        {
            string            attributeKey      = "attKey";
            string            attributeValue    = "attValue";
            string            name              = "some name";
            Type              type              = typeof(WrapHandlerNode);
            CustomHandlerData customHandlerData = new CustomHandlerData();

            customHandlerData.Attributes.Add(attributeKey, attributeValue);
            customHandlerData.Name = name;
            customHandlerData.Type = type;
            CustomHandlerNode customHandlerNode = new CustomHandlerNode(customHandlerData);
            CustomHandlerData nodeData          = (CustomHandlerData)customHandlerNode.ExceptionHandlerData;

            Assert.AreEqual(name, nodeData.Name);
            Assert.AreEqual(type, nodeData.Type);
            Assert.AreEqual(attributeKey, nodeData.Attributes.AllKeys[0]);
            Assert.AreEqual(attributeValue, nodeData.Attributes[attributeKey]);
        }
        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 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"]);
        }