<PackageReference Include="NUnit" Version="4.3.2" />

TestCaseParameters

The TestCaseParameters class encapsulates method arguments and other selected parameters needed for constructing a parameterized test case.
using NUnit.Framework.Interfaces; using System; using System.Runtime.CompilerServices; namespace NUnit.Framework.Internal { public class TestCaseParameters : TestParameters, ITestCaseData, ITestData, IApplyToTest { [Nullable(2)] private object _expectedResult; [Nullable(2)] public object ExpectedResult { [NullableContext(2)] get { return _expectedResult; } [NullableContext(2)] set { _expectedResult = value; HasExpectedResult = true; } } public bool HasExpectedResult { get; set; } [Nullable(new byte[] { 2, 1 })] [field: Nullable(new byte[] { 2, 1 })] public Type[] TypeArgs { [return: Nullable(new byte[] { 2, 1 })] get; [param: Nullable(new byte[] { 2, 1 })] set; } public TestCaseParameters() { } [NullableContext(1)] public TestCaseParameters(Exception exception) : base(exception) { } public TestCaseParameters([Nullable(new byte[] { 1, 2 })] object[] args) : base(args) { } [NullableContext(1)] public TestCaseParameters(ITestCaseData data) : base(data) { if (data.HasExpectedResult) ExpectedResult = data.ExpectedResult; } } }