Verifies the contents of a file.
[Fact]
public Task VerifyFilePath() =>
VerifyFile("sample.txt");
An optional info
parameter can be supplied to add more context to the test. The instance passed will be json serialized.
[Fact]
public Task VerifyFileWithInfo() =>
VerifyFile(
"sample.txt",
info: "the info");
[Fact]
public Task VerifyFilePathWithExtension() =>
VerifyFile("sample.txt", extension: "csv");
Use the functionality of VerifyTests outside of a unit test.
public async Task VerifyExternalFile()
{
using var verifier = new InnerVerifier(targetDirectory, name: "sample");
await verifier.VerifyFile(filePath);
}
Result:
{targetDirectory}/sample.verified.txt