using System;
using System.Linq;
using UnityEngine.TestRunner.NUnitExtensions.Runner;
using UnityEngine.TestTools.Logging;
using UnityEngine.TestTools.TestRunner;
namespace UnityEngine.TestTools.NUnitExtensions
{
///
/// This class delegates actions from the NUnit thread that should be executed on the main thread.
/// NUnit thread calls Delegate which blocks the execution on the thread until the action is executed.
/// The main thread will poll for awaiting actions (HasAction) and invoke them (Execute).
/// Once the action is executed, the main thread releases the lock and executino on the NUnit thread is continued.
///
internal class ActionDelegator : BaseDelegator
{
private Func