Is the feature request related to a problem
I'm working on a tool that replicates some behavior in another tool (in a non-dotnet language). I have unit tests that ensure that given the same inputs, my tool and the other tool should produce the same results (text file).
In my test project, I have a C# method that executes that tool (via Process.Start) to generate the "expected" data.
I would like to use Verify, and remain using the external process to generate the expected data, but also leverage Verify to cache that expected data.
It is unlikely that the expected data will change, once it's generated.
Describe the solution
Before:
[Test]
public async Task TestSomething(string inputA, string inputB)
{
var actual = RunMyTool(inputA, inputB);
var expected = await RunExternalTool(inputA, inputB);
Assert.That(actual, Is.EqualTo(expected));
}
After:
[Test]
public async Task TestSomething(string inputA, string inputB)
{
var settings = new VerifySettings();
settings.ExpectedDataGenerator = async () => await RunExternalTool(inputA, inputB);
var actual = RunMyTool(inputA, inputB);
return Verify(actual);
}
Describe alternatives considered
- Manually generate the expected data, each time I add new unit tests
- I don't know!
Additional context
Is the feature request related to a problem
I'm working on a tool that replicates some behavior in another tool (in a non-dotnet language). I have unit tests that ensure that given the same inputs, my tool and the other tool should produce the same results (text file).
In my test project, I have a C# method that executes that tool (via
Process.Start) to generate the "expected" data.I would like to use
Verify, and remain using the external process to generate the expected data, but also leverageVerifyto cache that expected data.It is unlikely that the expected data will change, once it's generated.
Describe the solution
Before:
After:
Describe alternatives considered
Additional context