holopy3/Assets/UniGLTF/DepthFirstScheduler/Editor/DepthFirstScheduler.cs
Lena Biresch 490ef558ef CleanUp
2021-01-28 13:07:52 +01:00

24 lines
601 B
C#

using NUnit.Framework;
using System.Linq;
namespace DepthFirstScheduler
{
public class DepthFirstScheduler
{
[Test]
public void ScheduleTreeTest()
{
var s = Schedulable.Create();
var tasks = s.GetRoot().Traverse().ToArray();
Assert.AreEqual(2, tasks.Length);
var task_int = s.AddTask(Scheduler.CurrentThread, () => 0);
task_int = task_int.ContinueWith(Scheduler.CurrentThread, _ => 1);
var status = s.Execute();
Assert.AreEqual(ExecutionStatus.Done, status);
}
}
}