|
The NUnit migration docs say:
But suppose I have a test method like: [Test]
[MethodDataSource(nameof(TestData))]
public async Task TestAThing(
string xaml,
int expectedStartTags,
int expectedEndTags,
int expectedTagNames)…and now I add [Test]
[MethodDataSource(nameof(TestData))] // error TUnit0001 here
public async Task TestAThing(
TestContext testContext,
string xaml,
int expectedStartTags,
int expectedEndTags,
int expectedTagNames)…then I get an error:
If I move the
(Presumably, this cannot work because the test context needs information on the current test.) So, I'm unsure how to get a |
Replies: 1 comment 2 replies
|
I'll tweak the docs. It can be injected into Before(Test) and After(Test) hooks. To get it inside a test, do TestContext.Current |
I'll tweak the docs. It can be injected into Before(Test) and After(Test) hooks.
To get it inside a test, do TestContext.Current