-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathBasicGraphTests.cs
More file actions
82 lines (63 loc) · 2.02 KB
/
BasicGraphTests.cs
File metadata and controls
82 lines (63 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using DotNetGraph.Core;
using DotNetGraph.Extensions;
using DotNetGraph.Node;
using NFluent;
using Xunit;
namespace DotNetGraph.Tests
{
public class BasicGraphTests
{
[Fact]
public void GraphWithSpaceInIdentifier()
{
var graph = new DotGraph("My test graph");
var compiled = graph.Compile();
Check.That(compiled).HasSameValueAs("graph \"My test graph\" { }");
}
[Fact]
public void EmptyDirectedGraph()
{
var graph = new DotGraph("TestGraph", true);
var compiled = graph.Compile();
Check.That(compiled).HasSameValueAs("digraph \"TestGraph\" { }");
}
[Fact]
public void EmptyGraph()
{
var graph = new DotGraph("TestGraph");
var compiled = graph.Compile();
Check.That(compiled).HasSameValueAs("graph \"TestGraph\" { }");
}
[Fact]
public void EmptyStrictGraph()
{
var graph = new DotGraph("TestGraph")
{
Strict = true
};
var compiled = graph.Compile();
Check.That(compiled).HasSameValueAs("strict graph \"TestGraph\" { }");
}
[Fact]
public void GraphWithoutStringsFormat()
{
var graph = new DotGraph("TestGraph", true);
graph.Elements.Add(new DotNode("TestNode")
{
Label = "\\lTesting"
});
var compiled = graph.Compile(false, false);
Check.That(compiled).HasSameValueAs("digraph \"TestGraph\" { \"TestNode\"[label=\"\\lTesting\"]; }");
}
[Fact]
public void GraphWithLayout()
{
var graph = new DotGraph("TestGraph", true)
{
Layout = DotGraphLayout.Neato
};
var compiled = graph.Compile(false, false);
Check.That(compiled).HasSameValueAs("digraph \"TestGraph\" { layout=neato; }");
}
}
}