Fix compatibility issue with pre-2.6 framework
This commit is contained in:
Родитель
31c15e5e6e
Коммит
e354d5a93d
|
@ -12,6 +12,7 @@
|
|||
<include name="ConsoleWriter.cs"/>
|
||||
<include name="DefaultTestRunnerFactory.cs"/>
|
||||
<include name="FileWatcher.cs" if="${runtime.version >= '2.0'}"/>
|
||||
<include name="Guard.cs"/>
|
||||
<include name="IAssemblyWatcher.cs"/>
|
||||
<include name="InProcessTestRunnerFactory.cs"/>
|
||||
<include name="MemorySettingsStorage.cs"/>
|
||||
|
|
|
@ -293,7 +293,7 @@ namespace NUnit.Core.Builders
|
|||
testMethod.arguments = parms.Arguments;
|
||||
testMethod.hasExpectedResult = parms.HasExpectedResult;
|
||||
if (testMethod.hasExpectedResult)
|
||||
testMethod.expectedResult = parms.ExpectedResult;
|
||||
testMethod.expectedResult = parms.Result;
|
||||
testMethod.RunState = parms.RunState;
|
||||
testMethod.IgnoreReason = parms.IgnoreReason;
|
||||
testMethod.BuilderException = parms.ProviderException;
|
||||
|
|
|
@ -143,7 +143,7 @@ namespace NUnit.Core.Extensibility
|
|||
/// The expected result of the test, which
|
||||
/// must match the method return type.
|
||||
/// </summary>
|
||||
public object ExpectedResult
|
||||
public object Result
|
||||
{
|
||||
get { return expectedResult; }
|
||||
set
|
||||
|
@ -294,9 +294,11 @@ namespace NUnit.Core.Extensibility
|
|||
if ( matchEnum != null )
|
||||
parms.MatchType = matchEnum.ToString();
|
||||
|
||||
// Note: pre-2.6 versions of some attributes don't have the HasExpectedResult property
|
||||
object hasResult = GetParm(source, PropertyNames.HasExpectedResult);
|
||||
if (hasResult != null && (bool)hasResult)
|
||||
parms.ExpectedResult = GetParm(source, PropertyNames.ExpectedResult);
|
||||
object expectedResult = GetParm(source, PropertyNames.ExpectedResult);
|
||||
if (hasResult != null && (bool)hasResult || expectedResult != null)
|
||||
parms.Result = expectedResult;
|
||||
|
||||
parms.Description = GetParm(source, PropertyNames.Description) as string;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace NUnit.Core
|
|||
/// <summary>ExpectedException MatchType</summary>
|
||||
public static readonly string MatchType = "MatchType";
|
||||
/// <summary>Expected return result from test</summary>
|
||||
public static readonly string ExpectedResult = "ExpectedResult";
|
||||
public static readonly string ExpectedResult = "Result";
|
||||
/// <summary>Indicates whether there is an expected return result</summary>
|
||||
public static readonly string HasExpectedResult = "HasExpectedResult";
|
||||
/// <summary>Description of the test</summary>
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace NUnit.Framework
|
|||
/// <summary>
|
||||
/// Gets the expected result
|
||||
/// </summary>
|
||||
object ExpectedResult { get; }
|
||||
object Result { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether a result has been specified.
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace NUnit.Framework
|
|||
/// <summary>
|
||||
/// Gets the expected result
|
||||
/// </summary>
|
||||
public object ExpectedResult
|
||||
public object Result
|
||||
{
|
||||
get { return expectedResult; }
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче