TestContext.CurrentContext.Test.Properties does not work with TestCase is specified
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
New
|
Undecided
|
Unassigned |
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]
public void MyPropTest_ok()
{
foreach (string key in TestContext.
{
}
}
public void MyPropTest_
{
foreach (string key in TestContext.
{
}
}
}
affects: | nunitv2 → nunit-3.0 |
It's possible that some changes we made to TestMethod were not
reflected on test cases.
Charlie
On Thu, Nov 22, 2012 at 6:25 AM, Ken Ko <email address hidden> wrote: 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/bugs/ 1082039 CurrentContext. Test.Properties does not work with TestCase /bugs.launchpad .net/nunitv2/ +bug/1082039/ +subscriptions
> Public bug reported:
>
> 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.
> }
>
> }
>
> ** Affects: nunitv2
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to NUnit
> Extended Testing Platform.
> https:/
>
> Title:
> TestContext.
> is specified
>
> To manage notifications about this bug go to:
> https:/