Example #1
0
        public void CanCreateCustomAttributeMatchingRuleNodeFromData()
        {
            CustomCallHandlerData handlerData = new CustomCallHandlerData();

            handlerData.Name     = "customHandler";
            handlerData.TypeName = "HandlerType";
            handlerData.Attributes.Add("Attribute1", "Value1");
            handlerData.Attributes.Add("Attribute2", "Value2");

            CustomCallHandlerNode handlerNode = new CustomCallHandlerNode(handlerData);

            Assert.AreEqual(handlerData.TypeName, handlerNode.Type);
            Assert.AreEqual(handlerData.Attributes.Count, handlerNode.Attributes.Count);
            Assert.AreEqual(handlerData.Attributes[0], handlerNode.Attributes[0].Value);
            Assert.AreEqual(handlerData.Attributes.AllKeys[0], handlerNode.Attributes[0].Key);
            Assert.AreEqual(handlerData.Attributes[1], handlerNode.Attributes[1].Value);
            Assert.AreEqual(handlerData.Attributes.AllKeys[1], handlerNode.Attributes[1].Key);
        }
Example #2
0
        public void CanCreateRuleDataFromCustomAttributeMatchingRuleNode()
        {
            CustomCallHandlerNode handlerNode = new CustomCallHandlerNode();

            handlerNode.Name = "cacheHandler";
            handlerNode.Type = "HandlerType";
            handlerNode.Attributes.Add(new Microsoft.Practices.EnterpriseLibrary.Configuration.Design.EditableKeyValue("Attribute1", "Value1"));
            handlerNode.Attributes.Add(new Microsoft.Practices.EnterpriseLibrary.Configuration.Design.EditableKeyValue("Attribute2", "Value2"));

            CustomCallHandlerData handlerData = handlerNode.CreateCallHandlerData() as CustomCallHandlerData;

            Assert.IsNotNull(handlerData);
            Assert.AreEqual(handlerNode.Type, handlerData.TypeName);
            Assert.AreEqual(handlerNode.Attributes.Count, handlerData.Attributes.Count);
            Assert.AreEqual(handlerNode.Attributes[0].Value, handlerData.Attributes[0]);
            Assert.AreEqual(handlerNode.Attributes[0].Key, handlerData.Attributes.AllKeys[0]);
            Assert.AreEqual(handlerNode.Attributes[1].Value, handlerData.Attributes[1]);
            Assert.AreEqual(handlerNode.Attributes[1].Key, handlerData.Attributes.AllKeys[1]);
        }
Example #3
0
        public void CustomCallHandlerNodeHasProperName()
        {
            CustomCallHandlerNode node = new CustomCallHandlerNode();

            Assert.AreEqual("Custom Handler", node.Name);
        }