public void AllVerticesDiscovered(IGraph <int> graph) { var visitor = new BasicVisitor <int>(); DFSTraversal.Traverse(graph, 0, visitor); Assert.That(visitor.DiscoveredVertices, Is.EquivalentTo(graph.Vertices)); }
public static async Task TranslateAsync(string name, Stream input, Stream output) { BasicVisitor program = new BasicVisitor(name); foreach (BasicLine line in await BasicStream.ReadAsync(input)) { line.Accept(program); } string outputCode = program.ToString(); byte[] rawOutput = Encoding.UTF8.GetBytes(outputCode.ToString()); await output.WriteAsync(rawOutput, 0, rawOutput.Length); }