A game about forced loneliness, made by TACStudios
1using NUnit.Framework.Interfaces;
2using NUnit.Framework.Internal;
3using NUnit.Framework.Internal.Commands;
4using System.Linq;
5
6namespace UnityEngine.TestTools
7{
8 internal class ParametrizedIgnoreCommand : TestCommand
9 {
10 private readonly TestCommand m_Command;
11
12 public object[] Arguments { get; }
13 public string Reason { get; }
14
15 public ParametrizedIgnoreCommand(TestCommand command, object[] arguments, string reason = "") : base(command.Test)
16 {
17 m_Command = command;
18 Arguments = arguments;
19 Reason = reason;
20 }
21
22 public override TestResult Execute(ITestExecutionContext context)
23 {
24 if (context.CurrentTest is TestMethod testMethod)
25 {
26 var isIgnored = testMethod.parms.Arguments.SequenceEqual(Arguments);
27 if (isIgnored)
28 {
29 context.CurrentResult.SetResult(ResultState.Ignored, Reason);
30 return context.CurrentResult;
31 }
32 }
33
34 return m_Command.Execute(context);
35 }
36 }
37}