public void Visualize_ObjectWithTwoInnerObjects_CreateSvg()
        {
            const string expectedSvgXml =
                "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Generated by graphviz version 2.28.0 (20110507.0327)\r\n -->\r\n<!-- Title: G Pages: 1 -->\r\n<svg width=\"195pt\" height=\"116pt\"\r\n viewBox=\"0.00 0.00 195.00 116.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n<g id=\"graph1\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 112)\">\r\n<title>G</title>\r\n<polygon fill=\"white\" stroke=\"white\" points=\"-4,5 -4,-112 192,-112 192,5 -4,5\"/>\r\n<!-- 0 -->\r\n<g id=\"node1\" class=\"node\"><title>0</title>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"108,-108 78,-108 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M78,-108C72,-108 66,-102 66,-96\"/>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"66,-96 66,-84 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M66,-84C66,-78 72,-72 78,-72\"/>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"78,-72 108,-72 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M108,-72C114,-72 120,-78 120,-84\"/>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"120,-84 120,-96 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M120,-96C120,-102 114,-108 108,-108\"/>\r\n<text text-anchor=\"middle\" x=\"93\" y=\"-86.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">&lt;null&gt;</text>\r\n</g>\r\n<!-- 1 -->\r\n<g id=\"node2\" class=\"node\"><title>1</title>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"72.25,-36 11.75,-36 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M11.75,-36C5.75,-36 -0.25,-30 -0.25,-24\"/>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"-0.25,-24 -0.25,-12 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M-0.25,-12C-0.25,-6 5.75,-0 11.75,-0\"/>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"11.75,-0 72.25,-0 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M72.25,-0C78.25,-0 84.25,-6 84.25,-12\"/>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"84.25,-12 84.25,-24 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M84.25,-24C84.25,-30 78.25,-36 72.25,-36\"/>\r\n<text text-anchor=\"middle\" x=\"42\" y=\"-14.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">innerobject1</text>\r\n</g>\r\n<!-- 0&#45;&gt;1 -->\r\n<g id=\"edge2\" class=\"edge\"><title>0&#45;&gt;1</title>\r\n<path fill=\"none\" stroke=\"black\" d=\"M80.3933,-71.6966C74.4026,-63.4741 67.1235,-53.4832 60.5208,-44.4207\"/>\r\n<polygon fill=\"black\" stroke=\"black\" points=\"63.1792,-42.1257 54.4617,-36.1043 57.5215,-46.2477 63.1792,-42.1257\"/>\r\n</g>\r\n<!-- 2 -->\r\n<g id=\"node3\" class=\"node\"><title>2</title>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"175.25,-36 114.75,-36 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M114.75,-36C108.75,-36 102.75,-30 102.75,-24\"/>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"102.75,-24 102.75,-12 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M102.75,-12C102.75,-6 108.75,-0 114.75,-0\"/>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"114.75,-0 175.25,-0 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M175.25,-0C181.25,-0 187.25,-6 187.25,-12\"/>\r\n<polyline fill=\"none\" stroke=\"black\" points=\"187.25,-12 187.25,-24 \"/>\r\n<path fill=\"none\" stroke=\"black\" d=\"M187.25,-24C187.25,-30 181.25,-36 175.25,-36\"/>\r\n<text text-anchor=\"middle\" x=\"145\" y=\"-14.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">innerobject2</text>\r\n</g>\r\n<!-- 0&#45;&gt;2 -->\r\n<g id=\"edge4\" class=\"edge\"><title>0&#45;&gt;2</title>\r\n<path fill=\"none\" stroke=\"black\" d=\"M105.854,-71.6966C112.025,-63.3893 119.537,-53.2771 126.324,-44.1407\"/>\r\n<polygon fill=\"black\" stroke=\"black\" points=\"129.14,-46.2189 132.294,-36.1043 123.521,-42.0446 129.14,-46.2189\"/>\r\n</g>\r\n</g>\r\n</svg>\r\n";

            var visualizer = new SvgVisualizer(VisualizerFactoryProvider.AttributeBasedFactoryProvider);
            var o          = new TestObjectWith2AttributedInners(new InnerObject1(), new InnerObject2());

            Assert.AreEqual(expectedSvgXml, visualizer.Visualize(o));
        }
예제 #2
0
 public void TestOne()
 {
     var visualizer = new SvgVisualizer(_factoryProvider.Object);
     var s          = visualizer.Visualize(new object());
 }