Hello!
I've been working on configuring our code to execute our tests through NCrunch. I'm having to change several private members of my classes to be public in order for some tests to work. These tests work properly when executed through Visual Studio, but not through NCrunch. Is this a bug? Is there another way around this?
For example, I have a test using the DynamicData attribute where the supplied source data name is a private property.
Code:
private static IEnumerable<object[]> TestParameters { get; } = GetTestParameters();
[DataTestMethod]
[DynamicData(nameof(TestParameters))]
public Task ExampleUnitTest(TestParams testParams)
{
return Task.CompletedTask;
}
The error NCrunch gives is:
Quote:Unable to resolve dynamic data source method: Test.UnitTestClassName::get_TestParameters
Making TestParameters public will fix this error.
Thanks!
Kevin