using System; using System.Collections.Generic; using UnityEngine; namespace UnityTest.IntegrationTestRunner { public class TestRunnerCallbackList : ITestRunnerCallback { private readonly List m_CallbackList = new List(); public void Add(ITestRunnerCallback callback) { m_CallbackList.Add(callback); } public void Remove(ITestRunnerCallback callback) { m_CallbackList.Remove(callback); } public void RunStarted(string platform, List testsToRun) { foreach (var unitTestRunnerCallback in m_CallbackList) { unitTestRunnerCallback.RunStarted(platform, testsToRun); } } public void RunFinished(List testResults) { foreach (var unitTestRunnerCallback in m_CallbackList) { unitTestRunnerCallback.RunFinished(testResults); } } public void TestStarted(TestResult test) { foreach (var unitTestRunnerCallback in m_CallbackList) { unitTestRunnerCallback.TestStarted(test); } } public void TestFinished(TestResult test) { foreach (var unitTestRunnerCallback in m_CallbackList) { unitTestRunnerCallback.TestFinished(test); } } public void TestRunInterrupted(List testsNotRun) { foreach (var unitTestRunnerCallback in m_CallbackList) { unitTestRunnerCallback.TestRunInterrupted(testsNotRun); } } } }