Do i miss something here? #5013
-
|
I have this: Thsis does not seems to work: I tried other combinations like Func<TestDataRow< but the test harness does not add them |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I think my previous explanation was too short, here is more detail: public class Foo This does not build, Changing to this: Can anybody clarify what is the right way to provide a TestDataRow that has 'DisplayName' ? |
Beta Was this translation helpful? Give feedback.
-
|
Apologies for my own confusion, figure out a way to make it work, for reference this is: } public class Foo |
Beta Was this translation helpful? Give feedback.
Apologies for my own confusion, figure out a way to make it work, for reference this is:
public static class RpcTestData
{
public static IEnumerable<Func<TestDataRow>> GeRpcContexts()
{
yield return () => new(new JsonRpcContext(), DisplayName: "JsonRpc");
}
public class Foo
{
[Test]
[MethodDataSource(typeof(RpcTestData), nameof(RpcTestData.GeRpcContexts))]
public async Task TestRequestAsync(IRpcContext _)
{
await Task.Delay(500);
}
}