nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #01563
[Merge] lp:~jterrell/nunitv2/action-attributes into lp:nunitv2
Jordan Terrell has proposed merging lp:~jterrell/nunitv2/action-attributes into lp:nunitv2.
Requested reviews:
NUnit Core Developers (nunit-core)
For more details, see:
https://code.launchpad.net/~jterrell/nunitv2/action-attributes/+merge/51485
Added better support for exceptions being thrown from action attributes.
--
https://code.launchpad.net/~jterrell/nunitv2/action-attributes/+merge/51485
Your team NUnit Core Developers is requested to review the proposed merge of lp:~jterrell/nunitv2/action-attributes into lp:nunitv2.
=== modified file 'src/NUnitCore/core/TestMethod.cs'
--- src/NUnitCore/core/TestMethod.cs 2011-02-26 22:08:59 +0000
+++ src/NUnitCore/core/TestMethod.cs 2011-02-28 02:13:55 +0000
@@ -312,10 +312,14 @@
TestResult testResult = new TestResult(this);
TestExecutionContext.CurrentContext.CurrentResult = testResult;
+ FailureSite failureSite = FailureSite.SetUp;
try
{
RunSetUp();
- RunBeforeActions();
+
+ failureSite = FailureSite.BeforeTestCaseAction;
+ RunBeforeActions(testResult);
+
RunTestCase( testResult );
}
@@ -326,7 +330,7 @@
if (ex is ThreadAbortException)
Thread.ResetAbort();
- RecordException(ex, testResult, FailureSite.SetUp);
+ RecordException(ex, testResult, failureSite);
}
finally
{
@@ -368,9 +372,9 @@
#region Invoke Methods by Reflection, Recording Errors
- private void RunBeforeActions()
+ private void RunBeforeActions(TestResult testResult)
{
- object[][] targetActions = new object[][] {this.suiteActions, this.actions};
+ object[][] targetActions = new object[][] { this.suiteActions, this.actions };
ActionsHelper.ExecuteActions(ActionLevel.Test, ActionPhase.Before, targetActions, this.Fixture, this.Method);
}
@@ -381,15 +385,16 @@
object[][] targetActions = new object[][] { this.suiteActions, this.actions };
ActionsHelper.ExecuteActions(ActionLevel.Test, ActionPhase.After, targetActions, this.Fixture, this.Method);
}
- catch(Exception ex)
+ catch (Exception ex)
{
if (ex is NUnitException)
ex = ex.InnerException;
// TODO: What about ignore exceptions in teardown?
- testResult.Error(ex, FailureSite.TearDown);
+ testResult.Error(ex, FailureSite.AfterTestCaseAction);
}
}
+
private void RunSetUp()
{
if (setUpMethods != null)
=== modified file 'src/NUnitCore/core/TestSuite.cs'
--- src/NUnitCore/core/TestSuite.cs 2011-02-26 22:08:59 +0000
+++ src/NUnitCore/core/TestSuite.cs 2011-02-28 02:13:55 +0000
@@ -391,9 +391,9 @@
this.IgnoreReason = ex.Message;
}
else if (IsAssertException(ex))
- suiteResult.Failure(ex.Message, ex.StackTrace, FailureSite.SetUp);
+ suiteResult.Failure(ex.Message, ex.StackTrace, FailureSite.BeforeTestSuiteAction);
else
- suiteResult.Error(ex, FailureSite.SetUp);
+ suiteResult.Error(ex, FailureSite.BeforeTestSuiteAction);
}
}
@@ -458,7 +458,7 @@
if (nex != null)
ex = nex.InnerException;
- suiteResult.Failure(ex.Message, ex.StackTrace, FailureSite.TearDown);
+ suiteResult.Failure(ex.Message, ex.StackTrace, FailureSite.AfterTestSuiteAction);
}
}
=== modified file 'src/NUnitCore/interfaces/ResultState.cs'
--- src/NUnitCore/interfaces/ResultState.cs 2010-07-31 21:14:12 +0000
+++ src/NUnitCore/interfaces/ResultState.cs 2011-02-28 02:13:55 +0000
@@ -74,6 +74,15 @@
/// </summary>
TearDown,
+
+ BeforeTestSuiteAction,
+
+ AfterTestSuiteAction,
+
+ BeforeTestCaseAction,
+
+ AfterTestCaseAction,
+
/// <summary>
/// Failure of a parent test
/// </summary>
=== added file 'src/NUnitCore/tests/ActionAttributeExceptionTests.cs'
--- src/NUnitCore/tests/ActionAttributeExceptionTests.cs 1970-01-01 00:00:00 +0000
+++ src/NUnitCore/tests/ActionAttributeExceptionTests.cs 2011-02-28 02:13:55 +0000
@@ -0,0 +1,99 @@
+using NUnit.Framework;
+using NUnit.TestData;
+using NUnit.TestData.ActionAttributeTests;
+
+namespace NUnit.Core.Tests
+{
+ [TestFixture]
+ public class ActionAttributeExceptionTests
+ {
+ private class Filter : TestFilter
+ {
+ public override bool Match(ITest test)
+ {
+ return test.TestName.FullName.StartsWith(typeof(ActionAttributeExceptionFixture).FullName);
+ }
+ }
+
+ private TestSuite _Suite = null;
+
+ [TestFixtureSetUp]
+ public void Setup()
+ {
+ TestSuiteBuilder builder = new TestSuiteBuilder();
+ TestPackage package = new TestPackage(AssemblyHelper.GetAssemblyPath(typeof(ActionAttributeExceptionFixture)));
+ package.TestName = typeof(ActionAttributeExceptionFixture).Namespace;
+
+ _Suite = builder.Build(package);
+ }
+
+ public TestResult RunTest()
+ {
+ return _Suite.Run(new NullListener(), new Filter());
+ }
+
+ private TestResult FindFailureTestResult(TestResult result)
+ {
+ while (result.FailureSite == FailureSite.Child && result.Results != null && result.Results.Count > 0)
+ result = (TestResult)result.Results[0];
+
+ return result;
+ }
+
+ [Test]
+ public void BeforeTestSuiteException()
+ {
+ ExceptionThrowingActionAttribute.Reset();
+ ExceptionThrowingActionAttribute.ThrowBeforeSuiteException = true;
+
+ ActionAttributeExceptionFixture.Reset();
+
+ TestResult result = FindFailureTestResult(RunTest());
+
+ Assert.IsTrue(result.FailureSite == FailureSite.BeforeTestSuiteAction);
+ Assert.IsFalse(ActionAttributeExceptionFixture.TestRun);
+ }
+
+ [Test]
+ public void AfterTestSuiteException()
+ {
+ ExceptionThrowingActionAttribute.Reset();
+ ExceptionThrowingActionAttribute.ThrowAfterSuiteException = true;
+
+ ActionAttributeExceptionFixture.Reset();
+
+ TestResult result = FindFailureTestResult(RunTest());
+
+ Assert.IsTrue(result.FailureSite == FailureSite.AfterTestSuiteAction);
+ Assert.IsTrue(ActionAttributeExceptionFixture.TestRun);
+ }
+
+ [Test]
+ public void BeforeTestCaseException()
+ {
+ ExceptionThrowingActionAttribute.Reset();
+ ExceptionThrowingActionAttribute.ThrowBeforeCaseException = true;
+
+ ActionAttributeExceptionFixture.Reset();
+
+ TestResult result = FindFailureTestResult(RunTest());
+
+ Assert.IsTrue(result.FailureSite == FailureSite.BeforeTestCaseAction);
+ Assert.IsFalse(ActionAttributeExceptionFixture.TestRun);
+ }
+
+ [Test]
+ public void AfterTestCaseException()
+ {
+ ExceptionThrowingActionAttribute.Reset();
+ ExceptionThrowingActionAttribute.ThrowAfterCaseException = true;
+
+ ActionAttributeExceptionFixture.Reset();
+
+ TestResult result = FindFailureTestResult(RunTest());
+
+ Assert.IsTrue(result.FailureSite == FailureSite.AfterTestCaseAction);
+ Assert.IsTrue(ActionAttributeExceptionFixture.TestRun);
+ }
+ }
+}
=== modified file 'src/NUnitCore/tests/ActionAttributeTests.cs'
--- src/NUnitCore/tests/ActionAttributeTests.cs 2011-02-26 22:08:59 +0000
+++ src/NUnitCore/tests/ActionAttributeTests.cs 2011-02-28 02:13:55 +0000
@@ -1,212 +1,212 @@
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using NUnit.Framework;
-using NUnit.TestData.ActionAttributeTests;
-
-namespace NUnit.Core.Tests
-{
- [TestFixture]
- public class ActionAttributeTests
- {
- private class ActionAttributeFixtureFilter : TestFilter
- {
- public override bool Match(ITest test)
- {
- return test.TestName.FullName.StartsWith(typeof(ActionAttributeFixture).FullName);
- }
- }
-
- private TestResult _result = null;
- private readonly string[] _definitionSites = new string[]
- {
- "Assembly",
- "BaseSetUpFixture",
- "SetUpFixture",
- "BaseInterface",
- "BaseFixture",
- "Interface",
- "Fixture",
- "Method"
- };
-
- [TestFixtureSetUp]
- public void Setup()
- {
- ActionAttributeFixture.Results = new StringCollection();
-
- TestSuiteBuilder builder = new TestSuiteBuilder();
- TestPackage package = new TestPackage(AssemblyHelper.GetAssemblyPath(typeof(ActionAttributeFixture)));
- package.TestName = typeof(ActionAttributeFixture).Namespace;
-
- Test suite = builder.Build(package);
- _result = suite.Run(new NullListener(), new ActionAttributeFixtureFilter());
- }
-
- [Test]
- public void TestsRunsSuccessfully()
- {
- Assert.IsTrue(_result.IsSuccess, "Test run was not successful.");
- Assert.Contains("SomeTest-Case1", ActionAttributeFixture.Results, "Test Case 1 was not run.");
- Assert.Contains("SomeTest-Case2", ActionAttributeFixture.Results, "Test Case 2 was not run.");
- Assert.Contains("SomeOtherTest", ActionAttributeFixture.Results, "SomeOtherTest was not run.");
-
- foreach(string message in ActionAttributeFixture.Results)
- Console.WriteLine(message);
- }
-
- [Test]
- public void DefinitionSites_BeforeSuite_ExecuteFirst_InOrder()
- {
- for (int i = 0; i < _definitionSites.Length - 1; i++)
- {
- string prefix = string.Format("{0}.BeforeTestSuite-", _definitionSites[i]);
-
- Assert.IsTrue(
- ActionAttributeFixture.Results[i].StartsWith(prefix),
- string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
- }
- }
-
-
- [Test]
- public void DefinitionSites_AfterSuite_ExecuteLast_InOrder()
- {
- int lastIndex = ActionAttributeFixture.Results.Count - 1;
- for (int i = lastIndex; i > lastIndex - _definitionSites.Length; i--)
- {
- string prefix = string.Format("{0}.AfterTestSuite-", _definitionSites[lastIndex - i]);
-
- Assert.IsTrue(
- ActionAttributeFixture.Results[i].StartsWith(prefix),
- string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
- }
- }
-
- [Test]
- public void DefinitionSites_BeforeTest_ExecuteInOrder_ForSomeOtherTest()
- {
- int startIndex = ActionAttributeFixture.Results.IndexOf("SomeOtherTest") - _definitionSites.Length - 1;
- for (int i = startIndex; i < startIndex; i++)
- {
- string prefix = string.Format("{0}.BeforeTestCase-", _definitionSites[i - startIndex]);
-
- Assert.IsTrue(
- ActionAttributeFixture.Results[i].StartsWith(prefix),
- string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
- }
- }
-
- [Test]
- public void DefinitionSites_AfterTest_ExecuteInOrder_ForSomeOtherTest()
- {
- int startIndex = ActionAttributeFixture.Results.IndexOf("SomeOtherTest");
- for (int i = 1; i <= _definitionSites.Length - 1; i++)
- {
- string prefix = string.Format("{0}.AfterTestCase-", _definitionSites[_definitionSites.Length - 1 - i]);
-
- Assert.IsTrue(
- ActionAttributeFixture.Results[startIndex + i].StartsWith(prefix),
- string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
- }
- }
-
- [Test]
- public void AllDefinitionSites_BeforeTest_ExecuteInOrder_ForSomeTestCase1()
- {
- int startIndex = ActionAttributeFixture.Results.IndexOf("SomeTest-Case1") - _definitionSites.Length;
- for (int i = startIndex; i < startIndex; i++)
- {
- string prefix = string.Format("{0}.BeforeTestCase-", _definitionSites[i - startIndex]);
-
- Assert.IsTrue(
- ActionAttributeFixture.Results[i].StartsWith(prefix),
- string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
- }
- }
-
- [Test]
- public void AllDefinitionSites_AfterTest_ExecuteInOrder_ForSomeTestCase1()
- {
- int startIndex = ActionAttributeFixture.Results.IndexOf("SomeTest-Case1");
- for (int i = 1; i <= _definitionSites.Length; i++)
- {
- string prefix = string.Format("{0}.AfterTestCase-", _definitionSites[_definitionSites.Length - i]);
-
- Assert.IsTrue(
- ActionAttributeFixture.Results[startIndex + i].StartsWith(prefix),
- string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
- }
- }
-
- [Test]
- public void AllDefinitionSites_BeforeTest_ExecuteInOrder_ForSomeTestCase2()
- {
- int startIndex = ActionAttributeFixture.Results.IndexOf("SomeTest-Case2") - _definitionSites.Length;
- for (int i = startIndex; i < startIndex; i++)
- {
- string prefix = string.Format("{0}.BeforeTestCase-", _definitionSites[i - startIndex]);
-
- Assert.IsTrue(
- ActionAttributeFixture.Results[i].StartsWith(prefix),
- string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
- }
- }
-
- [Test]
- public void AllDefinitionSites_AfterTest_ExecuteInOrder_ForSomeTestCase2()
- {
- int startIndex = ActionAttributeFixture.Results.IndexOf("SomeTest-Case2");
- for (int i = 1; i <= _definitionSites.Length; i++)
- {
- string prefix = string.Format("{0}.AfterTestCase-", _definitionSites[_definitionSites.Length - i]);
-
- Assert.IsTrue(
- ActionAttributeFixture.Results[startIndex + i].StartsWith(prefix),
- string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
- }
- }
-
- [Test]
- public void MethodDefinedSite_BeforeSuite_BeforeSomeTestCase1()
- {
- int testCase = ActionAttributeFixture.Results.IndexOf("SomeTest-Case1");
- Assert.IsTrue(testCase > ActionAttributeFixture.Results.IndexOf("Method.BeforeTestSuite-ActionAttributeFixture"));
- }
-
- [Test]
- public void MethodDefinedSite_AfterSuite_BeforeSomeTestCase2()
- {
- int testCase = ActionAttributeFixture.Results.IndexOf("SomeTest-Case2");
- Assert.IsTrue(testCase < ActionAttributeFixture.Results.IndexOf("Method.AfterTestSuite-ActionAttributeFixture"));
- }
-
- [Test]
- public void AllActions_BeforeAndAfterTest_HasAccessToFixture()
- {
- foreach(string message in ActionAttributeFixture.Results)
- {
- if (message.Contains("BeforeTestCase") || message.Contains("AfterTestCase"))
- Assert.IsTrue(message.Contains(typeof(ActionAttributeFixture).Name), string.Format("'{0}' shows action does not have access to fixture.", message));
- }
- }
-
- [Test]
- public void AllActions_BeforeAndAfterTest_HasAccessToMethodInfo()
- {
- StringCollection validEndSegments = new StringCollection();
- validEndSegments.AddRange(new string[] {"SomeOtherTest", "SomeTest"});
-
- foreach (string message in ActionAttributeFixture.Results)
- {
- if (message.Contains("BeforeTestCase") || message.Contains("AfterTestCase"))
- {
- string endSegment = message.Substring(message.LastIndexOf('-') + 1);
-
- Assert.IsTrue(validEndSegments.Contains(endSegment),
- string.Format("'{0}' shows action does not have access to method info.", message));
- }
- }
- }
- }
-}
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using NUnit.Framework;
+using NUnit.TestData.ActionAttributeTests;
+
+namespace NUnit.Core.Tests
+{
+ [TestFixture]
+ public class ActionAttributeTests
+ {
+ private class ActionAttributeFixtureFilter : TestFilter
+ {
+ public override bool Match(ITest test)
+ {
+ return test.TestName.FullName.StartsWith(typeof(ActionAttributeFixture).FullName);
+ }
+ }
+
+ private TestResult _result = null;
+ private readonly string[] _definitionSites = new string[]
+ {
+ "Assembly",
+ "BaseSetUpFixture",
+ "SetUpFixture",
+ "BaseInterface",
+ "BaseFixture",
+ "Interface",
+ "Fixture",
+ "Method"
+ };
+
+ [TestFixtureSetUp]
+ public void Setup()
+ {
+ ActionAttributeFixture.Results = new StringCollection();
+
+ TestSuiteBuilder builder = new TestSuiteBuilder();
+ TestPackage package = new TestPackage(AssemblyHelper.GetAssemblyPath(typeof(ActionAttributeFixture)));
+ package.TestName = typeof(ActionAttributeFixture).Namespace;
+
+ Test suite = builder.Build(package);
+ _result = suite.Run(new NullListener(), new ActionAttributeFixtureFilter());
+ }
+
+ [Test]
+ public void TestsRunsSuccessfully()
+ {
+ Assert.IsTrue(_result.IsSuccess, "Test run was not successful.");
+ Assert.Contains("SomeTest-Case1", ActionAttributeFixture.Results, "Test Case 1 was not run.");
+ Assert.Contains("SomeTest-Case2", ActionAttributeFixture.Results, "Test Case 2 was not run.");
+ Assert.Contains("SomeOtherTest", ActionAttributeFixture.Results, "SomeOtherTest was not run.");
+
+ foreach(string message in ActionAttributeFixture.Results)
+ Console.WriteLine(message);
+ }
+
+ [Test]
+ public void DefinitionSites_BeforeSuite_ExecuteFirst_InOrder()
+ {
+ for (int i = 0; i < _definitionSites.Length - 1; i++)
+ {
+ string prefix = string.Format("{0}.BeforeTestSuite-", _definitionSites[i]);
+
+ Assert.IsTrue(
+ ActionAttributeFixture.Results[i].StartsWith(prefix),
+ string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
+ }
+ }
+
+
+ [Test]
+ public void DefinitionSites_AfterSuite_ExecuteLast_InOrder()
+ {
+ int lastIndex = ActionAttributeFixture.Results.Count - 1;
+ for (int i = lastIndex; i > lastIndex - _definitionSites.Length; i--)
+ {
+ string prefix = string.Format("{0}.AfterTestSuite-", _definitionSites[lastIndex - i]);
+
+ Assert.IsTrue(
+ ActionAttributeFixture.Results[i].StartsWith(prefix),
+ string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
+ }
+ }
+
+ [Test]
+ public void DefinitionSites_BeforeTest_ExecuteInOrder_ForSomeOtherTest()
+ {
+ int startIndex = ActionAttributeFixture.Results.IndexOf("SomeOtherTest") - _definitionSites.Length - 1;
+ for (int i = startIndex; i < startIndex; i++)
+ {
+ string prefix = string.Format("{0}.BeforeTestCase-", _definitionSites[i - startIndex]);
+
+ Assert.IsTrue(
+ ActionAttributeFixture.Results[i].StartsWith(prefix),
+ string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
+ }
+ }
+
+ [Test]
+ public void DefinitionSites_AfterTest_ExecuteInOrder_ForSomeOtherTest()
+ {
+ int startIndex = ActionAttributeFixture.Results.IndexOf("SomeOtherTest");
+ for (int i = 1; i <= _definitionSites.Length - 1; i++)
+ {
+ string prefix = string.Format("{0}.AfterTestCase-", _definitionSites[_definitionSites.Length - 1 - i]);
+
+ Assert.IsTrue(
+ ActionAttributeFixture.Results[startIndex + i].StartsWith(prefix),
+ string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
+ }
+ }
+
+ [Test]
+ public void AllDefinitionSites_BeforeTest_ExecuteInOrder_ForSomeTestCase1()
+ {
+ int startIndex = ActionAttributeFixture.Results.IndexOf("SomeTest-Case1") - _definitionSites.Length;
+ for (int i = startIndex; i < startIndex; i++)
+ {
+ string prefix = string.Format("{0}.BeforeTestCase-", _definitionSites[i - startIndex]);
+
+ Assert.IsTrue(
+ ActionAttributeFixture.Results[i].StartsWith(prefix),
+ string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
+ }
+ }
+
+ [Test]
+ public void AllDefinitionSites_AfterTest_ExecuteInOrder_ForSomeTestCase1()
+ {
+ int startIndex = ActionAttributeFixture.Results.IndexOf("SomeTest-Case1");
+ for (int i = 1; i <= _definitionSites.Length; i++)
+ {
+ string prefix = string.Format("{0}.AfterTestCase-", _definitionSites[_definitionSites.Length - i]);
+
+ Assert.IsTrue(
+ ActionAttributeFixture.Results[startIndex + i].StartsWith(prefix),
+ string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
+ }
+ }
+
+ [Test]
+ public void AllDefinitionSites_BeforeTest_ExecuteInOrder_ForSomeTestCase2()
+ {
+ int startIndex = ActionAttributeFixture.Results.IndexOf("SomeTest-Case2") - _definitionSites.Length;
+ for (int i = startIndex; i < startIndex; i++)
+ {
+ string prefix = string.Format("{0}.BeforeTestCase-", _definitionSites[i - startIndex]);
+
+ Assert.IsTrue(
+ ActionAttributeFixture.Results[i].StartsWith(prefix),
+ string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
+ }
+ }
+
+ [Test]
+ public void AllDefinitionSites_AfterTest_ExecuteInOrder_ForSomeTestCase2()
+ {
+ int startIndex = ActionAttributeFixture.Results.IndexOf("SomeTest-Case2");
+ for (int i = 1; i <= _definitionSites.Length; i++)
+ {
+ string prefix = string.Format("{0}.AfterTestCase-", _definitionSites[_definitionSites.Length - i]);
+
+ Assert.IsTrue(
+ ActionAttributeFixture.Results[startIndex + i].StartsWith(prefix),
+ string.Format("Did not find prefix '{0}' at index {1}", prefix, i));
+ }
+ }
+
+ [Test]
+ public void MethodDefinedSite_BeforeSuite_BeforeSomeTestCase1()
+ {
+ int testCase = ActionAttributeFixture.Results.IndexOf("SomeTest-Case1");
+ Assert.IsTrue(testCase > ActionAttributeFixture.Results.IndexOf("Method.BeforeTestSuite-ActionAttributeFixture"));
+ }
+
+ [Test]
+ public void MethodDefinedSite_AfterSuite_BeforeSomeTestCase2()
+ {
+ int testCase = ActionAttributeFixture.Results.IndexOf("SomeTest-Case2");
+ Assert.IsTrue(testCase < ActionAttributeFixture.Results.IndexOf("Method.AfterTestSuite-ActionAttributeFixture"));
+ }
+
+ [Test]
+ public void AllActions_BeforeAndAfterTest_HasAccessToFixture()
+ {
+ foreach(string message in ActionAttributeFixture.Results)
+ {
+ if (message.Contains("BeforeTestCase") || message.Contains("AfterTestCase"))
+ Assert.IsTrue(message.Contains(typeof(ActionAttributeFixture).Name), string.Format("'{0}' shows action does not have access to fixture.", message));
+ }
+ }
+
+ [Test]
+ public void AllActions_BeforeAndAfterTest_HasAccessToMethodInfo()
+ {
+ StringCollection validEndSegments = new StringCollection();
+ validEndSegments.AddRange(new string[] {"SomeOtherTest", "SomeTest"});
+
+ foreach (string message in ActionAttributeFixture.Results)
+ {
+ if (message.Contains("BeforeTestCase") || message.Contains("AfterTestCase"))
+ {
+ string endSegment = message.Substring(message.LastIndexOf('-') + 1);
+
+ Assert.IsTrue(validEndSegments.Contains(endSegment),
+ string.Format("'{0}' shows action does not have access to method info.", message));
+ }
+ }
+ }
+ }
+}
=== modified file 'src/NUnitCore/tests/nunit.core.tests.csproj'
--- src/NUnitCore/tests/nunit.core.tests.csproj 2011-02-26 22:08:59 +0000
+++ src/NUnitCore/tests/nunit.core.tests.csproj 2011-02-28 02:13:55 +0000
@@ -1,242 +1,243 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <ProjectType>Local</ProjectType>
- <ProductVersion>9.0.21022</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{DD758D21-E5D5-4D40-9450-5F65A32F359C}</ProjectGuid>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <AssemblyKeyContainerName>
- </AssemblyKeyContainerName>
- <AssemblyName>nunit.core.tests</AssemblyName>
- <DefaultClientScript>JScript</DefaultClientScript>
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
- <DefaultTargetSchema>IE50</DefaultTargetSchema>
- <DelaySign>false</DelaySign>
- <OutputType>Library</OutputType>
- <RootNamespace>NUnit.Core.Tests</RootNamespace>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <OldToolsVersion>2.0</OldToolsVersion>
- <PublishUrl>http://localhost/nunit.core.tests/</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Web</InstallFrom>
- <UpdateEnabled>true</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>true</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>..\..\..\bin\Debug\tests\</OutputPath>
- <BaseAddress>285212672</BaseAddress>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>TRACE;DEBUG;NET_3_5;CS_3_0</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoWarn>618</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <WarningLevel>4</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>..\..\..\bin\Release\tests\</OutputPath>
- <BaseAddress>285212672</BaseAddress>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>TRACE;NET_2_0</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <FileAlignment>4096</FileAlignment>
- <NoWarn>618</NoWarn>
- <Optimize>true</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <WarningLevel>4</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="NSubstitute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\lib\NSubstitute.1.0.0.0\NSubstitute.dll</HintPath>
- </Reference>
- <Reference Include="System">
- <Name>System</Name>
- </Reference>
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data">
- <Name>System.Data</Name>
- </Reference>
- <Reference Include="System.Xml">
- <Name>System.XML</Name>
- </Reference>
- <ProjectReference Include="..\..\ClientUtilities\util\nunit.util.dll.csproj">
- <Name>nunit.util.dll</Name>
- <Project>{61CE9CE5-943E-44D4-A381-814DC1406767}</Project>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\NUnitFramework\framework\nunit.framework.dll.csproj">
- <Name>nunit.framework.dll</Name>
- <Project>{83DD7E12-A705-4DBA-9D71-09C8973D9382}</Project>
- </ProjectReference>
- <ProjectReference Include="..\..\tests\mock-assembly\mock-assembly.csproj">
- <Name>mock-assembly</Name>
- <Project>{2E368281-3BA8-4050-B05E-0E0E43F8F446}</Project>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\tests\nonamespace-assembly\nonamespace-assembly.csproj">
- <Name>nonamespace-assembly</Name>
- <Project>{5110F0D2-8E50-46F8-9E17-7C8EBFECCA9D}</Project>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\tests\test-assembly\test-assembly.csproj">
- <Name>test-assembly</Name>
- <Project>{1960CAC4-9A82-47C5-A9B3-55BC37572C3C}</Project>
- </ProjectReference>
- <ProjectReference Include="..\..\tests\test-utilities\test-utilities.csproj">
- <Name>test-utilities</Name>
- <Project>{3E63AD0F-24D4-46BE-BEE4-5A3299847D86}</Project>
- </ProjectReference>
- <ProjectReference Include="..\core\nunit.core.dll.csproj">
- <Name>nunit.core.dll</Name>
- <Project>{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}</Project>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\interfaces\nunit.core.interfaces.dll.csproj">
- <Name>nunit.core.interfaces.dll</Name>
- <Project>{435428F8-5995-4CE4-8022-93D595A8CC0F}</Project>
- <Private>False</Private>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\..\CommonAssemblyInfo.cs">
- <Link>CommonAssemblyInfo.cs</Link>
- </Compile>
- <Compile Include="ActionAttributeTests.cs" />
- <Compile Include="AllTests.cs" />
- <Compile Include="AssemblyHelperTests.cs" />
- <Compile Include="AssemblyReaderTests.cs" />
- <Compile Include="AssemblyResolverTests.cs" />
- <Compile Include="AssemblyTests.cs" />
- <Compile Include="AssemblyVersionFixture.cs" />
- <Compile Include="AssertPassFixture.cs" />
- <Compile Include="AttributeDescriptionFixture.cs" />
- <Compile Include="AttributeInheritance.cs" />
- <Compile Include="BasicRunnerTests.cs" />
- <Compile Include="CallContextTests.cs" />
- <Compile Include="CategoryAttributeTests.cs" />
- <Compile Include="CombinatorialTests.cs" />
- <Compile Include="CoreExtensionsTests.cs" />
- <Compile Include="CultureSettingAndDetectionTests.cs" />
- <Compile Include="DatapointTests.cs" />
- <Compile Include="DirectorySwapperTests.cs" />
- <Compile Include="EventQueueTests.cs" />
- <Compile Include="EventTestFixture.cs" />
- <Compile Include="ExpectExceptionTest.cs" />
- <Compile Include="FailFixture.cs" />
- <Compile Include="FixtureSetUpTearDownTest.cs" />
- <Compile Include="Generic\DeduceTypeArgsFromArgs.cs" />
- <Compile Include="Generic\SimpleGenericFixture.cs" />
- <Compile Include="Generic\SimpleGenericMethods.cs" />
- <Compile Include="Generic\TypeParameterUsedWithTestMethod.cs" />
- <Compile Include="IgnoreFixture.cs" />
- <Compile Include="LegacySuiteTests.cs" />
- <Compile Include="MaxTimeTests.cs" />
- <Compile Include="NameFilterTest.cs" />
- <Compile Include="NamespaceAssemblyTests.cs" />
- <Compile Include="PairwiseTests.cs" />
- <Compile Include="ParameterizedTestFixtureTests.cs" />
- <Compile Include="PlatformDetectionTests.cs" />
- <Compile Include="PropertyAttributeTests.cs" />
- <Compile Include="ReflectTests.cs" />
- <Compile Include="RemoteRunnerTests.cs" />
- <Compile Include="RepeatedTestFixture.cs" />
- <Compile Include="RuntimeFrameworkTests.cs" />
- <Compile Include="SerializationBug.cs" />
- <Compile Include="SetCultureAttributeTests.cs" />
- <Compile Include="SetUpFixtureTests.cs" />
- <Compile Include="SetUpTest.cs" />
- <Compile Include="SimpleNameFilterTests.cs" />
- <Compile Include="SimpleTestRunnerTests.cs" />
- <Compile Include="StackOverflowTestFixture.cs" />
- <Compile Include="SuiteBuilderTests.cs" />
- <Compile Include="SuiteBuilderTests_Multiple.cs" />
- <Compile Include="TestAssemblyBuilderTests.cs" />
- <Compile Include="TestCaseAttributeTests.cs" />
- <Compile Include="TestCaseResultFixture.cs" />
- <Compile Include="TestCaseSourceTests.cs" />
- <Compile Include="TestCaseTest.cs" />
- <Compile Include="TestConsole.cs" />
- <Compile Include="TestContextTests.cs" />
- <Compile Include="TestDelegateFixture.cs" />
- <Compile Include="TestExecutionContextTests.cs" />
- <Compile Include="TestFixtureBuilderTests.cs" />
- <Compile Include="TestFixtureExtension.cs" />
- <Compile Include="TestFixtureTests.cs" />
- <Compile Include="TestFrameworkTests.cs" />
- <Compile Include="TestIDTests.cs" />
- <Compile Include="TestInfoTests.cs" />
- <Compile Include="TestMethodSignatureTests.cs" />
- <Compile Include="TestNameTests.cs" />
- <Compile Include="TestNodeTests.cs" />
- <Compile Include="TestRunnerThreadTests.cs" />
- <Compile Include="TestSuiteTest.cs" />
- <Compile Include="TheoryTests.cs" />
- <Compile Include="ThreadedTestRunnerTests.cs" />
- <Compile Include="ThreadingTests.cs" />
- <Compile Include="TypeHelperTests.cs" />
- <Compile Include="UnhandledExceptionTests.cs" />
- <Compile Include="ValueSourceTests.cs" />
- <Compile Include="XmlTest.cs" />
- <Compile Include="DirectoryChangeTests.cs" />
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <None Include="nunit.core.tests.build" />
- <EmbeddedResource Include="Results.xsd" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PreBuildEvent>
- </PreBuildEvent>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{DD758D21-E5D5-4D40-9450-5F65A32F359C}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>nunit.core.tests</AssemblyName>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <OutputType>Library</OutputType>
+ <RootNamespace>NUnit.Core.Tests</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ <PublishUrl>http://localhost/nunit.core.tests/</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Web</InstallFrom>
+ <UpdateEnabled>true</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>true</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>..\..\..\bin\Debug\tests\</OutputPath>
+ <BaseAddress>285212672</BaseAddress>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE;DEBUG;NET_3_5;CS_3_0</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoWarn>618</NoWarn>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>..\..\..\bin\Release\tests\</OutputPath>
+ <BaseAddress>285212672</BaseAddress>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE;NET_2_0</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <FileAlignment>4096</FileAlignment>
+ <NoWarn>618</NoWarn>
+ <Optimize>true</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>none</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="NSubstitute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\lib\NSubstitute.1.0.0.0\NSubstitute.dll</HintPath>
+ </Reference>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.Xml">
+ <Name>System.XML</Name>
+ </Reference>
+ <ProjectReference Include="..\..\ClientUtilities\util\nunit.util.dll.csproj">
+ <Name>nunit.util.dll</Name>
+ <Project>{61CE9CE5-943E-44D4-A381-814DC1406767}</Project>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\NUnitFramework\framework\nunit.framework.dll.csproj">
+ <Name>nunit.framework.dll</Name>
+ <Project>{83DD7E12-A705-4DBA-9D71-09C8973D9382}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\..\tests\mock-assembly\mock-assembly.csproj">
+ <Name>mock-assembly</Name>
+ <Project>{2E368281-3BA8-4050-B05E-0E0E43F8F446}</Project>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\tests\nonamespace-assembly\nonamespace-assembly.csproj">
+ <Name>nonamespace-assembly</Name>
+ <Project>{5110F0D2-8E50-46F8-9E17-7C8EBFECCA9D}</Project>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\tests\test-assembly\test-assembly.csproj">
+ <Name>test-assembly</Name>
+ <Project>{1960CAC4-9A82-47C5-A9B3-55BC37572C3C}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\..\tests\test-utilities\test-utilities.csproj">
+ <Name>test-utilities</Name>
+ <Project>{3E63AD0F-24D4-46BE-BEE4-5A3299847D86}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\core\nunit.core.dll.csproj">
+ <Name>nunit.core.dll</Name>
+ <Project>{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}</Project>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\interfaces\nunit.core.interfaces.dll.csproj">
+ <Name>nunit.core.interfaces.dll</Name>
+ <Project>{435428F8-5995-4CE4-8022-93D595A8CC0F}</Project>
+ <Private>False</Private>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\..\CommonAssemblyInfo.cs">
+ <Link>CommonAssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="ActionAttributeExceptionTests.cs" />
+ <Compile Include="ActionAttributeTests.cs" />
+ <Compile Include="AllTests.cs" />
+ <Compile Include="AssemblyHelperTests.cs" />
+ <Compile Include="AssemblyReaderTests.cs" />
+ <Compile Include="AssemblyResolverTests.cs" />
+ <Compile Include="AssemblyTests.cs" />
+ <Compile Include="AssemblyVersionFixture.cs" />
+ <Compile Include="AssertPassFixture.cs" />
+ <Compile Include="AttributeDescriptionFixture.cs" />
+ <Compile Include="AttributeInheritance.cs" />
+ <Compile Include="BasicRunnerTests.cs" />
+ <Compile Include="CallContextTests.cs" />
+ <Compile Include="CategoryAttributeTests.cs" />
+ <Compile Include="CombinatorialTests.cs" />
+ <Compile Include="CoreExtensionsTests.cs" />
+ <Compile Include="CultureSettingAndDetectionTests.cs" />
+ <Compile Include="DatapointTests.cs" />
+ <Compile Include="DirectorySwapperTests.cs" />
+ <Compile Include="EventQueueTests.cs" />
+ <Compile Include="EventTestFixture.cs" />
+ <Compile Include="ExpectExceptionTest.cs" />
+ <Compile Include="FailFixture.cs" />
+ <Compile Include="FixtureSetUpTearDownTest.cs" />
+ <Compile Include="Generic\DeduceTypeArgsFromArgs.cs" />
+ <Compile Include="Generic\SimpleGenericFixture.cs" />
+ <Compile Include="Generic\SimpleGenericMethods.cs" />
+ <Compile Include="Generic\TypeParameterUsedWithTestMethod.cs" />
+ <Compile Include="IgnoreFixture.cs" />
+ <Compile Include="LegacySuiteTests.cs" />
+ <Compile Include="MaxTimeTests.cs" />
+ <Compile Include="NameFilterTest.cs" />
+ <Compile Include="NamespaceAssemblyTests.cs" />
+ <Compile Include="PairwiseTests.cs" />
+ <Compile Include="ParameterizedTestFixtureTests.cs" />
+ <Compile Include="PlatformDetectionTests.cs" />
+ <Compile Include="PropertyAttributeTests.cs" />
+ <Compile Include="ReflectTests.cs" />
+ <Compile Include="RemoteRunnerTests.cs" />
+ <Compile Include="RepeatedTestFixture.cs" />
+ <Compile Include="RuntimeFrameworkTests.cs" />
+ <Compile Include="SerializationBug.cs" />
+ <Compile Include="SetCultureAttributeTests.cs" />
+ <Compile Include="SetUpFixtureTests.cs" />
+ <Compile Include="SetUpTest.cs" />
+ <Compile Include="SimpleNameFilterTests.cs" />
+ <Compile Include="SimpleTestRunnerTests.cs" />
+ <Compile Include="StackOverflowTestFixture.cs" />
+ <Compile Include="SuiteBuilderTests.cs" />
+ <Compile Include="SuiteBuilderTests_Multiple.cs" />
+ <Compile Include="TestAssemblyBuilderTests.cs" />
+ <Compile Include="TestCaseAttributeTests.cs" />
+ <Compile Include="TestCaseResultFixture.cs" />
+ <Compile Include="TestCaseSourceTests.cs" />
+ <Compile Include="TestCaseTest.cs" />
+ <Compile Include="TestConsole.cs" />
+ <Compile Include="TestContextTests.cs" />
+ <Compile Include="TestDelegateFixture.cs" />
+ <Compile Include="TestExecutionContextTests.cs" />
+ <Compile Include="TestFixtureBuilderTests.cs" />
+ <Compile Include="TestFixtureExtension.cs" />
+ <Compile Include="TestFixtureTests.cs" />
+ <Compile Include="TestFrameworkTests.cs" />
+ <Compile Include="TestIDTests.cs" />
+ <Compile Include="TestInfoTests.cs" />
+ <Compile Include="TestMethodSignatureTests.cs" />
+ <Compile Include="TestNameTests.cs" />
+ <Compile Include="TestNodeTests.cs" />
+ <Compile Include="TestRunnerThreadTests.cs" />
+ <Compile Include="TestSuiteTest.cs" />
+ <Compile Include="TheoryTests.cs" />
+ <Compile Include="ThreadedTestRunnerTests.cs" />
+ <Compile Include="ThreadingTests.cs" />
+ <Compile Include="TypeHelperTests.cs" />
+ <Compile Include="UnhandledExceptionTests.cs" />
+ <Compile Include="ValueSourceTests.cs" />
+ <Compile Include="XmlTest.cs" />
+ <Compile Include="DirectoryChangeTests.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="nunit.core.tests.build" />
+ <EmbeddedResource Include="Results.xsd" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
</Project>
\ No newline at end of file
=== added file 'src/tests/test-assembly/ActionAttributeExceptionFixture.cs'
--- src/tests/test-assembly/ActionAttributeExceptionFixture.cs 1970-01-01 00:00:00 +0000
+++ src/tests/test-assembly/ActionAttributeExceptionFixture.cs 2011-02-28 02:13:55 +0000
@@ -0,0 +1,108 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using NUnit.Framework;
+
+namespace NUnit.TestData
+{
+ [ExceptionThrowingAction]
+ [TestFixture]
+ public class ActionAttributeExceptionFixture
+ {
+ public static bool SetUpRun = false;
+ public static bool TestRun = false;
+ public static bool TearDownRun = false;
+
+ public static void Reset()
+ {
+ SetUpRun = false;
+ TestRun = false;
+ TearDownRun = false;
+ }
+
+ [SetUp]
+ public void SetUp()
+ {
+ SetUpRun = true;
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ TearDownRun = false;
+ }
+
+ [ExceptionThrowingAction]
+ [Test]
+ public void SomeTest()
+ {
+ TestRun = true;
+ }
+ }
+
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
+ public class ExceptionThrowingActionAttribute : Attribute, ITestSuiteAction, ITestCaseAction
+ {
+ private static bool _ThrowBeforeSuiteException;
+ private static bool _ThrowAfterSuiteException;
+ private static bool _ThrowBeforeCaseException;
+ private static bool _ThrowAfterCaseException;
+
+ public static void Reset()
+ {
+ ThrowBeforeSuiteException = false;
+ ThrowAfterSuiteException = false;
+ ThrowBeforeCaseException = false;
+ ThrowAfterCaseException = false;
+ }
+
+ public void BeforeTestSuite(object fixture)
+ {
+ if (ThrowBeforeSuiteException)
+ throw new InvalidOperationException("Failure in BeforeTestSuite.");
+ }
+
+ public void AfterTestSuite(object fixture)
+ {
+ if (ThrowAfterSuiteException)
+ throw new InvalidOperationException("Failure in AfterTestSuite.");
+ }
+
+ public void BeforeTestCase(object fixture, MethodInfo method)
+ {
+ if (ThrowBeforeCaseException)
+ throw new InvalidOperationException("Failure in BeforeTestCase.");
+ }
+
+ public void AfterTestCase(object fixture, MethodInfo method)
+ {
+ if (ThrowAfterCaseException)
+ throw new InvalidOperationException("Failure in AfterTestCase.");
+ }
+
+ public static bool ThrowBeforeSuiteException
+ {
+ get { return _ThrowBeforeSuiteException; }
+ set { _ThrowBeforeSuiteException = value; }
+ }
+
+ public static bool ThrowAfterSuiteException
+ {
+ get { return _ThrowAfterSuiteException; }
+ set { _ThrowAfterSuiteException = value; }
+ }
+
+ public static bool ThrowBeforeCaseException
+ {
+ get { return _ThrowBeforeCaseException; }
+ set { _ThrowBeforeCaseException = value; }
+ }
+
+ public static bool ThrowAfterCaseException
+ {
+ get { return _ThrowAfterCaseException; }
+ set { _ThrowAfterCaseException = value; }
+ }
+ }
+}
=== modified file 'src/tests/test-assembly/test-assembly.csproj'
--- src/tests/test-assembly/test-assembly.csproj 2011-02-26 22:08:59 +0000
+++ src/tests/test-assembly/test-assembly.csproj 2011-02-28 02:13:55 +0000
@@ -1,170 +1,171 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <ProjectType>Local</ProjectType>
- <ProductVersion>9.0.21022</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{1960CAC4-9A82-47C5-A9B3-55BC37572C3C}</ProjectGuid>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <AssemblyKeyContainerName>
- </AssemblyKeyContainerName>
- <AssemblyName>test-assembly</AssemblyName>
- <DefaultClientScript>JScript</DefaultClientScript>
- <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
- <DefaultTargetSchema>IE50</DefaultTargetSchema>
- <DelaySign>false</DelaySign>
- <OutputType>Library</OutputType>
- <RootNamespace>NUnit.TestData</RootNamespace>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <OldToolsVersion>2.0</OldToolsVersion>
- <PublishUrl>http://localhost/test-assembly/</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Web</InstallFrom>
- <UpdateEnabled>true</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>true</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>..\..\..\bin\Debug\tests\</OutputPath>
- <BaseAddress>285212672</BaseAddress>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>TRACE;DEBUG;NET_2_0;CS_3_0</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <DebugSymbols>true</DebugSymbols>
- <FileAlignment>4096</FileAlignment>
- <NoWarn>618,672</NoWarn>
- <Optimize>false</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <WarningLevel>4</WarningLevel>
- <DebugType>full</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>..\..\..\bin\Release\tests\</OutputPath>
- <BaseAddress>285212672</BaseAddress>
- <ConfigurationOverrideFile>
- </ConfigurationOverrideFile>
- <DefineConstants>TRACE;NET_2_0</DefineConstants>
- <DocumentationFile>
- </DocumentationFile>
- <FileAlignment>4096</FileAlignment>
- <NoWarn>618,672</NoWarn>
- <Optimize>true</Optimize>
- <RegisterForComInterop>false</RegisterForComInterop>
- <RemoveIntegerChecks>false</RemoveIntegerChecks>
- <WarningLevel>4</WarningLevel>
- <DebugType>none</DebugType>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System">
- <Name>System</Name>
- </Reference>
- <Reference Include="System.Data">
- <Name>System.Data</Name>
- </Reference>
- <Reference Include="System.Xml">
- <Name>System.XML</Name>
- </Reference>
- <ProjectReference Include="..\..\NUnitCore\core\nunit.core.dll.csproj">
- <Name>nunit.core.dll</Name>
- <Project>{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}</Project>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\NUnitCore\interfaces\nunit.core.interfaces.dll.csproj">
- <Name>nunit.core.interfaces.dll</Name>
- <Project>{435428F8-5995-4CE4-8022-93D595A8CC0F}</Project>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\NUnitFramework\framework\nunit.framework.dll.csproj">
- <Name>nunit.framework.dll</Name>
- <Project>{83DD7E12-A705-4DBA-9D71-09C8973D9382}</Project>
- </ProjectReference>
- <ProjectReference Include="..\nonamespace-assembly\nonamespace-assembly.csproj">
- <Project>{5110F0D2-8E50-46F8-9E17-7C8EBFECCA9D}</Project>
- <Name>nonamespace-assembly</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\..\CommonAssemblyInfo.cs">
- <Link>CommonAssemblyInfo.cs</Link>
- </Compile>
- <Compile Include="AttributeDescriptionTests.cs" />
- <Compile Include="AttributeInheritance.cs" />
- <Compile Include="ActionAttributeFixture.cs" />
- <Compile Include="CategoryAttributeTests.cs" />
- <Compile Include="ConsoleRunnerTest.cs" />
- <Compile Include="CultureAttributeTests.cs" />
- <Compile Include="DatapointFixture.cs" />
- <Compile Include="ExpectExceptionTest.cs" />
- <Compile Include="FailFixtureTests.cs" />
- <Compile Include="FixtureSetUpTearDownTests.cs" />
- <Compile Include="IgnoreFixtureTests.cs" />
- <Compile Include="LegacySuiteData.cs" />
- <Compile Include="MaxTimeFixture.cs" />
- <Compile Include="ParameterizedTestFixture.cs" />
- <Compile Include="PropertyAttributeTests.cs" />
- <Compile Include="RepeatedTestFixtureTests.cs" />
- <Compile Include="SetupFixtureTests.cs" />
- <Compile Include="SetUpTest.cs" />
- <Compile Include="TestCaseAttributeFixture.cs" />
- <Compile Include="TestCaseSourceAttributeFixture.cs" />
- <Compile Include="TestCaseTest.cs" />
- <Compile Include="TestContextData.cs" />
- <Compile Include="TestData.cs" />
- <Compile Include="TestFixtureBuilderTests.cs" />
- <Compile Include="TestFixtureData.cs" />
- <Compile Include="TestFixtureExtensionTests.cs" />
- <Compile Include="TestMethodSignatureFixture.cs" />
- <Compile Include="TheoryFixture.cs" />
- <Compile Include="ThreadingFixture.cs" />
- <Compile Include="TypeHelperFixture.cs" />
- <Compile Include="UnhandledExceptions.cs" />
- <Compile Include="DirectoryChangeFixture.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="test-assembly.build" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <PropertyGroup>
- <PreBuildEvent>
- </PreBuildEvent>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{1960CAC4-9A82-47C5-A9B3-55BC37572C3C}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>test-assembly</AssemblyName>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <OutputType>Library</OutputType>
+ <RootNamespace>NUnit.TestData</RootNamespace>
+ <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ <PublishUrl>http://localhost/test-assembly/</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Web</InstallFrom>
+ <UpdateEnabled>true</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>true</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>..\..\..\bin\Debug\tests\</OutputPath>
+ <BaseAddress>285212672</BaseAddress>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE;DEBUG;NET_2_0;CS_3_0</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <NoWarn>618,672</NoWarn>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>..\..\..\bin\Release\tests\</OutputPath>
+ <BaseAddress>285212672</BaseAddress>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE;NET_2_0</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <FileAlignment>4096</FileAlignment>
+ <NoWarn>618,672</NoWarn>
+ <Optimize>true</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>none</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.Xml">
+ <Name>System.XML</Name>
+ </Reference>
+ <ProjectReference Include="..\..\NUnitCore\core\nunit.core.dll.csproj">
+ <Name>nunit.core.dll</Name>
+ <Project>{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}</Project>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\NUnitCore\interfaces\nunit.core.interfaces.dll.csproj">
+ <Name>nunit.core.interfaces.dll</Name>
+ <Project>{435428F8-5995-4CE4-8022-93D595A8CC0F}</Project>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\NUnitFramework\framework\nunit.framework.dll.csproj">
+ <Name>nunit.framework.dll</Name>
+ <Project>{83DD7E12-A705-4DBA-9D71-09C8973D9382}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\nonamespace-assembly\nonamespace-assembly.csproj">
+ <Project>{5110F0D2-8E50-46F8-9E17-7C8EBFECCA9D}</Project>
+ <Name>nonamespace-assembly</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\..\CommonAssemblyInfo.cs">
+ <Link>CommonAssemblyInfo.cs</Link>
+ </Compile>
+ <Compile Include="ActionAttributeExceptionFixture.cs" />
+ <Compile Include="AttributeDescriptionTests.cs" />
+ <Compile Include="AttributeInheritance.cs" />
+ <Compile Include="ActionAttributeFixture.cs" />
+ <Compile Include="CategoryAttributeTests.cs" />
+ <Compile Include="ConsoleRunnerTest.cs" />
+ <Compile Include="CultureAttributeTests.cs" />
+ <Compile Include="DatapointFixture.cs" />
+ <Compile Include="ExpectExceptionTest.cs" />
+ <Compile Include="FailFixtureTests.cs" />
+ <Compile Include="FixtureSetUpTearDownTests.cs" />
+ <Compile Include="IgnoreFixtureTests.cs" />
+ <Compile Include="LegacySuiteData.cs" />
+ <Compile Include="MaxTimeFixture.cs" />
+ <Compile Include="ParameterizedTestFixture.cs" />
+ <Compile Include="PropertyAttributeTests.cs" />
+ <Compile Include="RepeatedTestFixtureTests.cs" />
+ <Compile Include="SetupFixtureTests.cs" />
+ <Compile Include="SetUpTest.cs" />
+ <Compile Include="TestCaseAttributeFixture.cs" />
+ <Compile Include="TestCaseSourceAttributeFixture.cs" />
+ <Compile Include="TestCaseTest.cs" />
+ <Compile Include="TestContextData.cs" />
+ <Compile Include="TestData.cs" />
+ <Compile Include="TestFixtureBuilderTests.cs" />
+ <Compile Include="TestFixtureData.cs" />
+ <Compile Include="TestFixtureExtensionTests.cs" />
+ <Compile Include="TestMethodSignatureFixture.cs" />
+ <Compile Include="TheoryFixture.cs" />
+ <Compile Include="ThreadingFixture.cs" />
+ <Compile Include="TypeHelperFixture.cs" />
+ <Compile Include="UnhandledExceptions.cs" />
+ <Compile Include="DirectoryChangeFixture.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="test-assembly.build" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
</Project>
\ No newline at end of file