private IEnumerable<string> NodeAndEdgesFor(Azzembly azzembly) { if (!azzembly.HasDependencies()) yield return NodeOnlyFor(azzembly); foreach (var dependency in azzembly.Dependencies) { yield return NodeAndEdgeFor(azzembly, dependency); } }
public void ShouldRenderAssemblyWithoutDependencies() { var azzembly = new Azzembly("Foo"); Assert.That(Render(azzembly), DigraphContaining("Foo")); }
public void ShouldRenderAssemblyWithOneDependency() { var azzembly = new Azzembly("Foo").WithDependencies("Bar"); Assert.That(Render(azzembly), DigraphContaining("Foo", "Bar")); }
private string NodeOnlyFor(Azzembly azzembly) { return WrapInQuotes(azzembly.Name); }
private string NodeAndEdgeFor(Azzembly azzembly, Azzembly dependency) { return string.Format("{0} -> {1}", WrapInQuotes(azzembly.Name), WrapInQuotes(dependency.Name)); }
private void EntriesFor(Azzembly azzembly) { NodeAndEdgesFor(azzembly).ToList().ForEach(line => writer.WriteLine("{0}{1}", INDENT, line)); }