-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathTimerTimedWait.cs
executable file
·45 lines (40 loc) · 1.35 KB
/
TimerTimedWait.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//using System;
//using NUnit.Framework;
//namespace Flow.Test
//{
// [TestFixture]
// class TimerWaitTest : TestBase
// {
// // Broke this test when I removed IFactory.Parallel
// // I thought Node did the same thing...
// //[TestCase(0.5f)]
// //[TestCase(0.2f)]
// //public void TestBreak(float timeOut)
// //{
// // _root.Add(
// // New.Node(
// // New.While(() => true,
// // New.OneShotTimer(TimeSpan.FromSeconds(timeOut), (self) => self.Kernel.BreakFlow())
// // )
// // )
// // );
// // Print(_root);
// // var delta = RunKernel(2) - timeOut;
// // Assert.IsTrue(Math.Abs(delta) < 0.1f);
// //}
// [TestCase(0.5f, 1.0f, 0.5f)]
// [TestCase(1.5f, 1.0f, 1.0f)]
// public void TestTimedWait(float timerLen, float timeOut, float kernelRunTime)
// {
// Root.Add(
// New.WaitFor(
// New.Trigger(New.OneShotTimer(TimeSpan.FromSeconds(timerLen))),
// TimeSpan.FromSeconds(timeOut)
// ),
// New.Break()
// );
// var delta = timerLen - RunKernel(kernelRunTime);
// Assert.IsTrue(Math.Abs(delta) < 0.1f);
// }
// }
//}