Thanks for the quick response. I only started using the TestContext in v2.6
Just tried in 2.5.10 and got the same fail.
On 23/11/2012, at 5:35 AM, Simone Busoli <email address hidden> wrote:
> Hi Ken, can you tell what was the latest version where it used to work?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1082039
>
> Title:
> TestContext.CurrentContext.Test.Properties does not work with TestCase
> is specified
>
> Status in NUnit V2 Test Framework:
> New
>
> Bug description:
> Tried in v2.6 and v2.6.2 through default NUnit Gui runner
> Any property attribute specified on the test method stops coming through as soon as it becomes a TestCase
> See example below. Identical tests, one is [Test] , one is [TestCase]
>
>
> [TestFixture]
> public class TestNUnitPropertiesIssue
> {
> [Test]
> [Property("prop1", "prop1value")]
> public void MyPropTest_ok()
> {
> foreach (string key in TestContext.CurrentContext.Test.Properties.Keys)
> {
> Console.WriteLine("{0}: {1}", key, TestContext.CurrentContext.Test.Properties[key]);
> }
> Assert.AreEqual("prop1value", TestContext.CurrentContext.Test.Properties["prop1"]);
> }
>
> [TestCase("1")]
> [Property("prop1", "prop1value")]
> public void MyPropTest_fail(string s)
> {
> foreach (string key in TestContext.CurrentContext.Test.Properties.Keys)
> {
> Console.WriteLine("{0}: {1}", key, TestContext.CurrentContext.Test.Properties[key]);
> }
> Assert.AreEqual("prop1value", TestContext.CurrentContext.Test.Properties["prop1"]);
> }
>
> }
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nunitv2/+bug/1082039/+subscriptions
Thanks for the quick response. I only started using the TestContext in v2.6
Just tried in 2.5.10 and got the same fail.
On 23/11/2012, at 5:35 AM, Simone Busoli <email address hidden> wrote:
> Hi Ken, can you tell what was the latest version where it used to work? /bugs.launchpad .net/bugs/ 1082039 CurrentContext. Test.Properties does not work with TestCase tiesIssue CurrentContext. Test.Properties .Keys) WriteLine( "{0}: {1}", key, TestContext. CurrentContext. Test.Properties [key]); AreEqual( "prop1value" , TestContext. CurrentContext. Test.Properties ["prop1" ]); fail(string s) CurrentContext. Test.Properties .Keys) WriteLine( "{0}: {1}", key, TestContext. CurrentContext. Test.Properties [key]); AreEqual( "prop1value" , TestContext. CurrentContext. Test.Properties ["prop1" ]); /bugs.launchpad .net/nunitv2/ +bug/1082039/ +subscriptions
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> TestContext.
> is specified
>
> Status in NUnit V2 Test Framework:
> New
>
> Bug description:
> Tried in v2.6 and v2.6.2 through default NUnit Gui runner
> Any property attribute specified on the test method stops coming through as soon as it becomes a TestCase
> See example below. Identical tests, one is [Test] , one is [TestCase]
>
>
> [TestFixture]
> public class TestNUnitProper
> {
> [Test]
> [Property("prop1", "prop1value")]
> public void MyPropTest_ok()
> {
> foreach (string key in TestContext.
> {
> Console.
> }
> Assert.
> }
>
> [TestCase("1")]
> [Property("prop1", "prop1value")]
> public void MyPropTest_
> {
> foreach (string key in TestContext.
> {
> Console.
> }
> Assert.
> }
>
> }
>
> To manage notifications about this bug go to:
> https:/