Fix compatibility issue with pre-2.6 framework

This commit is contained in:
Charlie Poole 2012-02-18 21:59:50 -08:00
Родитель 31c15e5e6e
Коммит e354d5a93d
6 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -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; }
}