public void SadCaseTests(string graphDefinition, string triggers) { var graph = new UpdateGraph <string>(); var allSteps = GetUpdateGraphFromString(graph, graphDefinition); var triggs = triggers.Select(c => c.ToString()); Assert.Throws <UpdateGraphException>(() => graph.Trigger(triggs)); }
public void HappyCaseTests(string graphDefinition, string triggers, string expectedUpdateOrder) { var graph = new UpdateGraph <string>(); var allSteps = GetUpdateGraphFromString(graph, graphDefinition); var triggs = triggers.Select(c => c.ToString()); graph.Trigger(triggs); AssertGraph(allSteps, expectedUpdateOrder.Split(' ').Select(s => s.Split(':'))); }
public int RunStuff() { var graph = new UpdateGraph <int>(); for (var i = 0; i < Updaters; ++i) { graph.AddUpdate(new[] { i }, DoNothing, new[] { i + 1 }); } graph.Trigger(0); return(Updaters); }