コード例 #1
0
ファイル: RepeaterTest.cs プロジェクト: mateusazis/treesharp
        public void Init()
        {
             c5 = new IterComp(5, RunStatus.Success);
             c10 = new IterComp(10, RunStatus.Success);

             r1 = new Repeater(c5);
             r2 = new Repeater(c10);

             fixedAction = new TreeSharp.Action((TreeSharp.ActionDelegate)DoNothing);
             fixedRepeater = new Repeater(fixedAction, FIXED_REPEATER_COUNT);
        }
コード例 #2
0
ファイル: RepeaterTest.cs プロジェクト: mateusazis/treesharp
 public void SimpleActionTest()
 {
     int x = 0;
     const int count = 23;
     TreeSharp.Action action = new TreeSharp.Action(
         delegate(object context)
     {
         x++;
     });
     Repeater actionRepeater = new Repeater(action);
     actionRepeater.Start(null);
     for (int i = 0; i < count; i++)
         actionRepeater.Tick(null);
     
     Assert.AreEqual<int>(count, x);
 }