Questions tagged [approval-tests]

ApprovalTests is an open source library written for several languages (.NET, Java, PHP, more) which has been designed to support unit testing based on the idea of a Golden Master. To download go to www.ApprovalTests.com.

ApprovalTests is an open source library written for several languages (.NET, Java, PHP, more) which has been designed to support unit testing based on the idea of a Golden Master. To learn more go to www.ApprovalTests.com official site. There is also a YouTube playlist of screencasts (by Llewellyn) on using ApprovalTests with .NET and a dedicated blog. To get the sources you can go to the Git repository.

46 questions
20
votes
1 answer

How do I address this error: vstest.executionengine.x86.exe has stopped working?

After adding a new unit test with multiple VS versions running I get this error: vstest.executionengine.x86.exe has stopped working in a popup window.
Matt Linder
  • 431
  • 3
  • 9
16
votes
2 answers

How to place approval file for approvaltests in a folder of their own?

I can't find out how to move the .approved. files to a folder of their own in Approval-tests. I guess the information is there somewhere - I just can't find it. https://github.com/approvals/ApprovalTests.Net
LosManos
  • 7,195
  • 6
  • 56
  • 107
12
votes
4 answers

How to use ApprovalTests on Teamcity?

I am using Approval Tests. On my dev machine I am happy with DiffReporter that starts TortoiseDiff when my test results differ from approved: [UseReporter(typeof (DiffReporter))] public class MyApprovalTests { ... } However when the…
the_joric
  • 11,986
  • 6
  • 36
  • 57
6
votes
2 answers

How to add support for xunit's Theory attribute in Approvaltests

When I try to use approvals with my unit test decorated with [Theory] attribute it says: System.Exception: System.Exception : Approvals is not set up to use your test framework. It currently supports [NUnit, MsTest, MbUnit, xUnit.net] To add one use…
the_joric
  • 11,986
  • 6
  • 36
  • 57
5
votes
3 answers

How do I automatically approve approval-tests when I run them?

I'm using ApprovalTests.Net. I see that I can specify various reports. I would like to automatically approve the tests when I run the unit tests. I need to do this only temporarily, or when the code goes through major changes. This is…
zumalifeguard
  • 8,648
  • 5
  • 43
  • 56
5
votes
1 answer

Approval-Test throws System.MissingMethodException

I am trying to use Approval-Tests but can't even run "Hello World". When I run the test I get Test Name: TestHelloWorld Test FullName: HelloApprovalTests.Class1.TestHelloWorld Test Source: C:\Users\Lassi\Documents\Visual Studio…
Lassi Autio
  • 1,147
  • 1
  • 13
  • 35
5
votes
1 answer

How to remove approval's debug info from build logs

When I am running approval tests some debug output from approval test gets to my logs. It looks like 2/15/2016 1:58:48 PM ~000002ms Variable: approvalFrame = '' 2/15/2016 1:58:48 PM ~000025ms Variable: approvalFrame = '' 2/15/2016 1:58:48 PM…
the_joric
  • 11,986
  • 6
  • 36
  • 57
5
votes
4 answers

What causes the message "Approvals is not set up to use your test framework."?

What causes the message "Approvals is not set up to use your test framework."? We have an ApprovalTests-based unit test that is failing in a nightly remote team build with the following exception: Test method Test_CanvasModeConverters threw…
5
votes
3 answers

Approvaltests and PDF

Can I use ApprovalTests with PDF's? I tried using the FileLauncher but it seems the identical PDF's are slightly different at file (bit) level. Or did I use it wrongly? [TestMethod] [UseReporter(typeof(FileLauncherReporter))] public void…
joeriks
  • 3,382
  • 8
  • 32
  • 42
4
votes
1 answer

Convention on printing STL containers for approval tests

I'm writing approval tests using the excellent ApprovalTests.cpp library. This library automates generation of "snapshots" of results from a function. Snapshots are generated serializing results of type T to a file using the ostream& operator<< (T…
Alessandro Pezzato
  • 8,603
  • 5
  • 45
  • 63
4
votes
1 answer

Possible to change the filename of approval test

I'd like to run an approval test in a loop so that I can test 100-1000s of XML files. I get the serialiser to output to a string and then use that in the Verify() call. However, I'd like to be able set the verify method to use a different filename…
user183872
  • 767
  • 2
  • 6
  • 20
4
votes
2 answers

Verify multiple images with ApprovalTest

I have a method which generates a few images (1.jpg, 2.jpg...) writing them to the file system. I want to verify the results of this method with ApprovalTest. The problem is that Approvals.verify(image) names the received and approved files as the…
Andrey Minogin
  • 4,521
  • 6
  • 38
  • 60
3
votes
1 answer

How to use approval-tests WinMergeReporter w/ ncrunch

I've been using approval-tests for a while with the WinMergeReporter and it is working well with the standard NUnit runner executable. I am trying out NCrunch and the approval.Verify fails (as expected) for a new approval. However, WinMerge does not…
James Bradt
  • 564
  • 5
  • 11
2
votes
1 answer

Anyone used approvaltests with specflow?

Has anyone used Specflow with ApprovalTests? I find it limiting that you can only approve one file per NUnit test and therefore each scenario can only have one approved file. This is the case even if you use scenario outlines. This means I usually…
Martin Capodici
  • 1,486
  • 23
  • 27
2
votes
0 answers

How to make ApprovalTests create UTF-8 files

I use Visual Studio 2019 and have added ApprovalTests nuget package. Test class is configured with [UseReporter(typeof(DiffReporter))] and approval is done with Approvals.Verify(result) It works fine except for the file encoding. In VS I get two…
Jakob Lithner
  • 4,225
  • 6
  • 38
  • 59
1
2 3 4