? bin
? context.diff
? my.patch
? solutions/vs2008/_ReSharper.nunit
? solutions/vs2008/bin
? solutions/vs2008/nunit.suo
? solutions/vs2008/ClientUtilities/tests/obj
? solutions/vs2008/ClientUtilities/tests/resources
? solutions/vs2008/ClientUtilities/util/Extensibility
? solutions/vs2008/ClientUtilities/util/ProjectConverters
? solutions/vs2008/ClientUtilities/util/Services
? solutions/vs2008/ClientUtilities/util/obj
? solutions/vs2008/ConsoleRunner/nunit-console/obj
? solutions/vs2008/ConsoleRunner/nunit-console-exe/obj
? solutions/vs2008/ConsoleRunner/tests/obj
? solutions/vs2008/GuiComponents/UiKit/obj
? solutions/vs2008/GuiComponents/tests/obj
? solutions/vs2008/GuiException/UIException/CSharpParser
? solutions/vs2008/GuiException/UIException/CodeFormatters
? solutions/vs2008/GuiException/UIException/Controls
? solutions/vs2008/GuiException/UIException/Properties
? solutions/vs2008/GuiException/UIException/StackTraceAnalysers
? solutions/vs2008/GuiException/UIException/obj
? solutions/vs2008/GuiException/tests/CSharpParser
? solutions/vs2008/GuiException/tests/CodeFormatters
? solutions/vs2008/GuiException/tests/Controls
? solutions/vs2008/GuiException/tests/StackTraceAnalysers
? solutions/vs2008/GuiException/tests/obj
? solutions/vs2008/GuiRunner/nunit-gui/SettingsPages
? solutions/vs2008/GuiRunner/nunit-gui/obj
? solutions/vs2008/GuiRunner/nunit-gui-exe/Properties
? solutions/vs2008/GuiRunner/nunit-gui-exe/obj
? solutions/vs2008/GuiRunner/tests/obj
? solutions/vs2008/NUnitCore/core/Builders
? solutions/vs2008/NUnitCore/core/Extensibility
? solutions/vs2008/NUnitCore/core/obj
? solutions/vs2008/NUnitCore/interfaces/Extensibility
? solutions/vs2008/NUnitCore/interfaces/Filters
? solutions/vs2008/NUnitCore/interfaces/obj
? solutions/vs2008/NUnitCore/tests/Generic
? solutions/vs2008/NUnitCore/tests/obj
? solutions/vs2008/NUnitFixtures/fixtures/obj
? solutions/vs2008/NUnitFixtures/tests/obj
? solutions/vs2008/NUnitFramework/framework/Constraints
? solutions/vs2008/NUnitFramework/framework/nunit.framework.dll.csproj.user
? solutions/vs2008/NUnitFramework/framework/obj
? solutions/vs2008/NUnitFramework/tests/Constraints
? solutions/vs2008/NUnitFramework/tests/Syntax
? solutions/vs2008/NUnitFramework/tests/TestContextTests.cs
? solutions/vs2008/NUnitFramework/tests/obj
? solutions/vs2008/NUnitMocks/mocks/obj
? solutions/vs2008/NUnitMocks/tests/obj
? solutions/vs2008/NUnitTestServer/nunit-agent-exe/obj
? solutions/vs2008/NUnitTestServer/nunit-server-exe/obj
? solutions/vs2008/PNUnit/agent/obj
? solutions/vs2008/PNUnit/launcher/obj
? solutions/vs2008/PNUnit/pnunit.framework/obj
? solutions/vs2008/PNUnit/tests/obj
? solutions/vs2008/tests/loadtest-assembly/AAA
? solutions/vs2008/tests/loadtest-assembly/BBB
? solutions/vs2008/tests/loadtest-assembly/CCC
? solutions/vs2008/tests/loadtest-assembly/DDD
? solutions/vs2008/tests/loadtest-assembly/Properties
? solutions/vs2008/tests/loadtest-assembly/obj
? solutions/vs2008/tests/mock-assembly/obj
? solutions/vs2008/tests/nonamespace-assembly/obj
? solutions/vs2008/tests/test-assembly/obj
? solutions/vs2008/tests/test-utilities/obj
? solutions/vs2008/tests/timing-tests/obj
? src/GeneratedAssemblyInfo.cs
Index: solutions/vs2008/NUnitFramework/framework/nunit.framework.dll.csproj
===================================================================
RCS file: /cvsroot/nunit/nunit20/solutions/vs2008/NUnitFramework/framework/nunit.framework.dll.csproj,v
retrieving revision 1.38
diff -u -r1.38 nunit.framework.dll.csproj
--- solutions/vs2008/NUnitFramework/framework/nunit.framework.dll.csproj	6 Jul 2009 03:39:01 -0000	1.38
+++ solutions/vs2008/NUnitFramework/framework/nunit.framework.dll.csproj	7 Aug 2009 04:53:40 -0000
@@ -312,6 +312,9 @@
       <Link>TestAttribute.cs</Link>
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="..\..\..\..\src\NUnitFramework\framework\TestContext.cs">
+      <Link>TestContext.cs</Link>
+    </Compile>
     <Compile Include="..\..\..\..\src\NUnitFramework\framework\TestFixtureAttribute.cs">
       <Link>TestFixtureAttribute.cs</Link>
       <SubType>Code</SubType>
@@ -324,6 +327,9 @@
       <Link>TestFixtureTearDownAttribute.cs</Link>
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="..\..\..\..\src\NUnitFramework\framework\TestState.cs">
+      <Link>TestState.cs</Link>
+    </Compile>
     <Compile Include="..\..\..\..\src\NUnitFramework\framework\Text.cs">
       <Link>Text.cs</Link>
     </Compile>
Index: src/NUnitCore/core/TestMethod.cs
===================================================================
RCS file: /cvsroot/nunit/nunit20/src/NUnitCore/core/TestMethod.cs,v
retrieving revision 1.50
diff -u -r1.50 TestMethod.cs
--- src/NUnitCore/core/TestMethod.cs	6 Jul 2009 05:27:46 -0000	1.50
+++ src/NUnitCore/core/TestMethod.cs	7 Aug 2009 04:53:41 -0000
@@ -4,6 +4,9 @@
 // copyright ownership at http://nunit.org.
 // ****************************************************************
 
+using System.Collections;
+using System.Runtime.Remoting.Messaging;
+
 namespace NUnit.Core
 {
 	using System;
@@ -24,7 +27,9 @@
 	{
         static Logger log = InternalTrace.GetLogger(typeof(TestMethod));
 
-		#region Fields
+        static ContextDictionary context;
+
+        #region Fields
 		/// <summary>
 		/// The test method
 		/// </summary>
@@ -75,8 +80,22 @@
 		}
 		#endregion
 
-		#region Properties
-		public MethodInfo Method
+        #region Static Properties
+	    private static ContextDictionary Context
+	    {
+	        get
+	        {
+	            if (context==null)
+	            {
+	                context = new ContextDictionary();
+	            }
+	            return context;
+	        }
+	    }
+        #endregion
+
+        #region Properties
+        public MethodInfo Method
 		{
 			get { return method; }
 		}
@@ -126,6 +145,9 @@
             using (new TestContext())
             {
                 TestResult testResult = new TestResult(this);
+                ContextDictionary context = Context;
+                context._testResult = testResult;
+                CallContext.SetData("NUnit.Framework.TestContext", context);
 
                 log.Debug("Test Starting: " + this.TestName.FullName);
                 listener.TestStarted(this.TestName);
@@ -335,5 +357,26 @@
             testResult.SetResult(NUnitFramework.GetResultState(exception), exception);
 		}
 		#endregion
+
+        #region Inner Classes
+        private class ContextDictionary : Hashtable
+        {
+            internal TestResult _testResult;
+
+            public override object this[object key]
+            {
+                get
+                {
+                    if ("State".Equals(key))
+                        return (int)_testResult.ResultState;
+                    return base[key];
+                }
+                set
+                {
+                    base[key] = value;
+                }
+            }
+        }
+        #endregion
     }
 }
Index: src/NUnitCore/interfaces/ResultState.cs
===================================================================
RCS file: /cvsroot/nunit/nunit20/src/NUnitCore/interfaces/ResultState.cs,v
retrieving revision 1.9
diff -u -r1.9 ResultState.cs
--- src/NUnitCore/interfaces/ResultState.cs	6 Jul 2009 05:27:46 -0000	1.9
+++ src/NUnitCore/interfaces/ResultState.cs	7 Aug 2009 04:53:41 -0000
@@ -15,42 +15,42 @@
         /// <summary>
         /// The result is inconclusive
         /// </summary>
-        Inconclusive,
+        Inconclusive = 0,
 
         /// <summary>
         /// The test was not runnable.
         /// </summary>
-		NotRunnable, 
+		NotRunnable = 1, 
 
         /// <summary>
         /// The test has been skipped. 
         /// </summary>
-		Skipped,
+		Skipped = 2,
 
         /// <summary>
         /// The test has been ignored.
         /// </summary>
-		Ignored,
+		Ignored = 3,
 
         /// <summary>
         /// The test succeeded
         /// </summary>
-		Success,
+		Success = 4,
 
         /// <summary>
         /// The test failed
         /// </summary>
-		Failure,
+		Failure = 5,
 
         /// <summary>
         /// The test encountered an unexpected exception
         /// </summary>
-		Error,
+		Error = 6,
 
         /// <summary>
         /// The test was cancelled by the user
         /// </summary>
-        Cancelled
+        Cancelled = 7
 	}
 
     /// <summary>
Index: src/NUnitFramework/framework/TestContext.cs
===================================================================
RCS file: src/NUnitFramework/framework/TestContext.cs
diff -N src/NUnitFramework/framework/TestContext.cs
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/NUnitFramework/framework/TestContext.cs	7 Aug 2009 04:53:41 -0000
@@ -0,0 +1,38 @@
+﻿using System;
+using System.Collections;
+using System.Runtime.Remoting.Messaging;
+
+namespace NUnit.Framework
+{
+    /// <summary>
+    /// Provide the context information of the current test
+    /// </summary>
+    public static class TestContext
+    {
+        private const string contextKey = "NUnit.Framework.TestContext";
+        private const string stateKey = "State";
+
+        private static IDictionary _context;
+
+        private static IDictionary Context
+        {
+            get
+            {
+                if (_context == null)
+                    _context = (IDictionary)CallContext.GetData(contextKey);
+                return _context;
+            }
+        }
+
+        /// <summary>
+        /// The state of current test.
+        /// </summary>
+        public static TestState State
+        {
+            get
+            {
+                return (TestState) Enum.ToObject(typeof (TestState), (int)Context[stateKey]);
+            }
+        }
+    }
+}
Index: src/NUnitFramework/framework/TestState.cs
===================================================================
RCS file: src/NUnitFramework/framework/TestState.cs
diff -N src/NUnitFramework/framework/TestState.cs
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/NUnitFramework/framework/TestState.cs	7 Aug 2009 04:53:41 -0000
@@ -0,0 +1,48 @@
+namespace NUnit.Framework
+{
+    /// <summary>
+    /// The TestState enum indicates the current result of the running test
+    /// </summary>
+    public enum TestState
+    {
+        /// <summary>
+        /// The result is inconclusive
+        /// </summary>
+        Inconclusive = 0,
+
+        /// <summary>
+        /// The test was not runnable.
+        /// </summary>
+        NotRunnable = 1,
+
+        /// <summary>
+        /// The test has been skipped. 
+        /// </summary>
+        Skipped = 2,
+
+        /// <summary>
+        /// The test has been ignored.
+        /// </summary>
+        Ignored = 3,
+
+        /// <summary>
+        /// The test succeeded
+        /// </summary>
+        Success = 4,
+
+        /// <summary>
+        /// The test failed
+        /// </summary>
+        Failure = 5,
+
+        /// <summary>
+        /// The test encountered an unexpected exception
+        /// </summary>
+        Error = 6,
+
+        /// <summary>
+        /// The test was cancelled by the user
+        /// </summary>
+        Cancelled = 7
+    }
+}
\ No newline at end of file
Index: src/NUnitFramework/framework/nunit.framework.build
===================================================================
RCS file: /cvsroot/nunit/nunit20/src/NUnitFramework/framework/nunit.framework.build,v
retrieving revision 1.78
diff -u -r1.78 nunit.framework.build
--- src/NUnitFramework/framework/nunit.framework.build	6 Jul 2009 03:39:01 -0000	1.78
+++ src/NUnitFramework/framework/nunit.framework.build	7 Aug 2009 04:53:41 -0000
@@ -85,9 +85,11 @@
         <include name="TestCaseAttribute.cs"/>
         <include name="TestCaseData.cs"/>
         <include name="TestCaseSourceAttribute.cs"/>
+        <include name="TestContext.cs"/>
         <include name="TestFixtureAttribute.cs"/>
         <include name="TestFixtureSetUpAttribute.cs"/>
         <include name="TestFixtureTearDownAttribute.cs"/>
+        <include name="TestState.cs"/>
         <include name="Text.cs"/>
         <include name="TextMessageWriter.cs"/>
         <include name="TheoryAttribute.cs"/>
