2

I want the content to remain a text file, so code such as:

Approvals.Verify("some actual result as text");

Should continue to work. But I would like the approval tests to write to a ..approval.csv file or a ..approval.log file instead of ..approval.txt file.

I looked through the code and I think I may need to create a custom IApprovalWriter, but I also notice that the ExtensionWithDot property is read/write, so I'm wondering how this can be set.

Does anyone know how to do that?

zumalifeguard
  • 8,648
  • 5
  • 43
  • 56

1 Answers1

3
ApprovalTests.Approvals.Verify(WriterFactory.CreateTextWriter(text, fileExtensionWithoutDot));

or for your example:

Approvals.Verify(WriterFactory.CreateTextWriter("some actual result as text", "log"));

Happy Testing!

llewellyn falco
  • 2,281
  • 16
  • 13