A game about forced loneliness, made by TACStudios
at master 1.2 kB view raw
1using System; 2using System.Collections; 3using System.Collections.Generic; 4using NUnit.Framework.Interfaces; 5using NUnit.Framework.Internal; 6using NUnit.Framework.Internal.Commands; 7using UnityEngine.TestRunner.NUnitExtensions.Runner; 8 9namespace UnityEngine.TestTools 10{ 11 internal class EnumerableApplyChangesToContextCommand : ApplyChangesToContextCommand, IEnumerableTestMethodCommand 12 { 13 public EnumerableApplyChangesToContextCommand(TestCommand innerCommand, IEnumerable<IApplyToContext> changes) 14 : base(innerCommand, changes) {} 15 16 public IEnumerable ExecuteEnumerable(ITestExecutionContext context) 17 { 18 ApplyChanges(context); 19 20 if (innerCommand is IEnumerableTestMethodCommand) 21 { 22 var executeEnumerable = ((IEnumerableTestMethodCommand)innerCommand).ExecuteEnumerable(context); 23 foreach (var iterator in executeEnumerable) 24 { 25 yield return iterator; 26 } 27 } 28 else 29 { 30 context.CurrentResult = innerCommand.Execute(context); 31 } 32 } 33 } 34}