protected override CodeblockSystem BuildSystem() { CodeblockSystem system = new CodeblockSystem(); const int desiredLoopCount = 4; int loopRunCount = 0; ActionBlock loopCountIncrement = new ActionBlock(); loopCountIncrement.Action = () => loopRunCount++; DynamicInputOperator <int> count = new DynamicInputOperator <int>(); count.Value = desiredLoopCount; ForLoopBlock forLoop = new ForLoopBlock(); forLoop.LoopCount = count; AssertTestBlock assert = new AssertTestBlock(); assert.Condition = () => loopRunCount == desiredLoopCount; forLoop.Children.InsertItem(loopCountIncrement, null); system.Blocks.InsertItem(forLoop, null); system.Blocks.InsertItem(assert, forLoop); return(system); }
protected override CodeblockSystem BuildSystem() { CodeblockSystem system = new CodeblockSystem(); AssertTestBlock poisonedBlock = new AssertTestBlock(); poisonedBlock.Condition = () => false; BreakCodeblock breakBlock = new BreakCodeblock(); DynamicInputOperator <int> count = new DynamicInputOperator <int>(); count.Value = 100; ForLoopBlock flb = new ForLoopBlock(); flb.LoopCount = count; flb.Children.InsertItem(breakBlock, null); flb.Children.InsertItem(poisonedBlock, breakBlock); system.Blocks.InsertItem(flb, null); return(system); }