Skip to content

Make TestMethod.Arguments public or otherwise accessible (e.g. TestContext) #2079

Closed
@bartoszkp

Description

@bartoszkp

NUnit 3.6.1 (from NuGet)

I need a property in test's base class that returns a different value depending on test method's parameters (details in this SO question: http://stackoverflow.com/questions/42763574/how-to-get-current-parameter-value-from-testcontext - I don't feel they are strictly relevant here though).

I've created a ITestAction attribute and in the BeforeTest call I have access to TestMethod instance describing currently executed test.

If I could read the Arguments property I could react and accordingly set some properties in the fixture's base. Unfortunately, it's internal. This doesn't seem justified - a TestMethod description should naturally present method call arguments to the clients.

As a side note, I've tried also to use properties for this scenario, but even though I added them to my TestCaseSource results, they are not accessible from test method's level (probably related to issues #1358, #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