Skip to content

TestContext.CurrentContext.Test.Properties does not contain value(s) from PropertyAttribute when using TestCaseAttribute #1358

@corsairmarks

Description

@corsairmarks

NUnit version: 3.2.0 (from NuGet)

Test execution: Visual Studio adapter

Steps to reproduce:

  1. Create a test method marked with [TestCase] and [Property("key", "value")]
  2. Executed the test
  3. Inspect the value of TestContext.Current.Test.Properties - it will be an empty collection, where it should have 1 value

Code example (failing test):

[TestCase(5)]
[Property("Answer", 42)]
public void TestCaseCanAccessItsOwnProperties(int x)
{
    Assert.That(TestContext.CurrentContext.Test.Properties.Get("Answer"), Is.EqualTo(42));
}

Previously reported on LaunchPad

This does not appear to be the same bug as #548 or #796.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions