예제 #1
0
        public void CustomFormatterNodeDefaults()
        {
            CustomFormatterNode customFormatter = new CustomFormatterNode();

            Assert.AreEqual("Custom Formatter", customFormatter.Name);
            Assert.IsNull(customFormatter.Type);
        }
        public void CustomFormatterNodeTest()
        {
            string attributeKey = "attKey";
            string attributeValue = "attValue";
            string name = "some name";
            Type type = typeof(BinaryLogFormatter);

            CustomFormatterNode formatterNode = new CustomFormatterNode();
            formatterNode.Attributes.Add(new EditableKeyValue(attributeKey, attributeValue));
            formatterNode.Name = name;
            formatterNode.Type = type;

            CustomFormatterData nodeData = (CustomFormatterData) formatterNode.FormatterData;

            Assert.AreEqual(name, nodeData.Name);
            Assert.AreEqual(type, nodeData.Type);
            Assert.AreEqual(attributeKey, nodeData.Attributes.AllKeys[0]);
            Assert.AreEqual(attributeValue, nodeData.Attributes[attributeKey]);
        }
예제 #3
0
        public void CustomFormatterDataTest()
        {
            string attributeKey = "attKey";
            string attributeValue = "attValue";
            string name = "some name";
            Type type = typeof(BinaryLogFormatter);

            CustomFormatterData data = new CustomFormatterData();
            data.Name = name;
            data.Type = type;

            data.Attributes.Add(attributeKey, attributeValue);

            CustomFormatterNode node = new CustomFormatterNode(data);

            Assert.AreEqual(name, node.Name);
            Assert.AreEqual(type, node.Type);
            Assert.AreEqual(attributeKey, node.Attributes[0].Key);
            Assert.AreEqual(attributeValue, node.Attributes[0].Value);
        }