Exemplo n.º 1
0
        public void ShouldDoubleQuote()
        {
            using (var workspace = new AdhocWorkspace())
            {
                var p1 = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), "A", "A", "C#");
                var p2 = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), "B.C", "B.C", "C#");

                using (var m = new MemoryStream())
                {
                    using (var sw = new StreamWriter(m))
                    {
                        using (var reporter = new DotReporter(sw))
                        {
                            var a = workspace.AddProject(p1);
                            var b = workspace.AddProject(p2);
                            reporter.Report(a);
                            reporter.Report(b);

                            reporter.Report((a, b));
                        }
                        sw.Flush();
                    }

                    Assert.Equal(@"digraph G {
    ""A""
    ""B.C""
    ""A"" -> ""B.C""
}
".Replace("\r\n", "\n"), System.Text.Encoding.UTF8.GetString(m.ToArray()).Replace("\r\n", "\n"));
                }
            }
        }
Exemplo n.º 2
0
        public void ShouldCloseGraph()
        {
            using (var m = new MemoryStream())
            {
                using (var sw = new StreamWriter(m))
                {
                    using (var reporter = new DotReporter(sw))
                    {
                    }
                    sw.Flush();
                }

                Assert.Equal(@"digraph G {
}
".Replace("\r\n", "\n"), System.Text.Encoding.UTF8.GetString(m.ToArray()).Replace("\r\n", "\n"));
            }
        }