示例#1
0
        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));
        }
示例#2
0
        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(':')));
        }
示例#3
0
        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);
        }