Ejemplo n.º 1
0
        public void GivenString_ThenEscapesItWhenNeeded(string input, string expected)
        {
            DotHelper dh     = new DotHelper();
            string    result = dh.EscapeId(input);

            Assert.Equal(expected, result);
        }
Ejemplo n.º 2
0
        public void GivenString_WhenCheckedQuoted_ThenReturnsProperValues(string input, bool isQuotedProperly)
        {
            DotHelper dh     = new DotHelper();
            bool      result = dh.IsProperlyQuoted(input);

            Assert.Equal(isQuotedProperly, result);
        }
Ejemplo n.º 3
0
        public void GivenStringAttribute_ThenReturnsProperRecordForIt()
        {
            LabelAttribute la       = new LabelAttribute("b");
            DotHelper      dh       = new DotHelper();
            string         record   = dh.GetRecordFromAttribute(la);
            string         expected = la.Key + "=b";

            Assert.Equal(expected, record);
        }
Ejemplo n.º 4
0
        public void GivenColorAttribute_ThenReturnsProperRecordForIt()
        {
            string             hexColor           = "#C6C6C6";
            IGraphVizColor     colorValue         = GraphVizColor.FromHex(hexColor);
            FillColorAttribute fillColorAttribute = new FillColorAttribute(colorValue);
            DotHelper          dh       = new DotHelper();
            string             record   = dh.GetRecordFromAttribute(fillColorAttribute);
            string             expected = $"{fillColorAttribute.Key}=\"#C6C6C6\"";

            Assert.Equal(expected, record);
        }
Ejemplo n.º 5
0
        public Widget GetWidget(MethodDefinition method)
        {
            Digraph digraph = GetIlSourceAsDot(method);

            Image image = new Image(DotHelper.BuildDotImage(digraph));

            ScrolledWindow sw = new ScrolledWindow();

            sw.AddWithViewport(image);
            sw.ShowAll();
            return(sw);
        }
Ejemplo n.º 6
0
        public Widget GetWidget(MethodDefinition method)
        {
            BackwardAnalysis(">", null, method);
            Digraph digraph = BuildDotFile(method);

            Image image = new Image(DotHelper.BuildDotImage(digraph));

            ScrolledWindow sw = new ScrolledWindow();

            sw.AddWithViewport(image);
            sw.ShowAll();
            Clear();
            return(sw);
        }
        public Widget GetWidget(AssemblyDefinition assembly)
        {
            this.assembly = assembly;
            Digraph digraph = GetDotData(assembly);

            image = new Image(DotHelper.BuildDotImage(digraph));

            AddinScrolledWindow sw = new AddinScrolledWindow();

            sw.AddWithViewport(image);
            sw.ShowAll();
            sw.OnRefresh += delegate  {
                Refresh();
            };
            return(sw);
        }
        public void Refresh()
        {
            Digraph digraph = GetDotData(assembly);

            image.FromFile = DotHelper.BuildDotImage(digraph);
        }