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
2
votes
1 answer

Default values missing for ServiceStack.XmlServiceClient response

While using TestCaseSource in unit testing for multiple ServiceStack service clients, deserialized to a string format for the XmlServiceClient does not match the deserialized for JsonServiceClient or JsvServiceClient. The serialization is using the…
2
votes
2 answers

ApprovalTests with TestCase (Nunit) use the same approval file

I have a problem that using ApprovalTests.Net and NUnit all the tests that are run use the same approval file which name originates from Test method name. Is it possible to specify somehow for each test case separate approval file?…
phoenix
  • 365
  • 1
  • 4
  • 15
2
votes
1 answer

Ignore attributes' order when comparing xml with ApprovalTests

I am trying to Approvals.Verify xml but problem is attributes' order. In few elements they are in different order in my computerand Jenkins. From other question I found to change order of properties in class. That kinda worked: it changed…
Lassi Autio
  • 1,147
  • 1
  • 13
  • 35
2
votes
1 answer

Is there a way I can use a different extension than .txt such as .log or .csv when using ApprovalTests?

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…
zumalifeguard
  • 8,648
  • 5
  • 43
  • 56
2
votes
1 answer

Specifying the test output path using ApprovalTests.Net to support multiple files

I am writing an application which generates PDF files from HTML markup (using a third party library to do so). I'd like to be able to approval test the output of these PDF files so to do so I've been looking at the ApprovalTests.Net library. My…
Dan
  • 968
  • 1
  • 8
  • 21
2
votes
2 answers

ApprovalTests DiffReporter is not popping up diff window unless the diff tool is open

I've been having an issue with ApprovalTests recently where the diff tool (BeyondCompare 3, in my case; I have a co-worker with the same issue using WinMerge) is flashing open and then closes immediately. The only way for the tool to stay open is by…
Rob H
  • 1,840
  • 16
  • 25
2
votes
1 answer

ApprovalTests failing when files are identical

im using approvals verify in c# Approvals.Verify(player.ToString()); and it opens in code compare and even when I copy it over it is still failing. why is it doing this and how can I fix it?
2
votes
1 answer

Controlling the Namer in WpfApprovals in ApprovalTests

I ran into a problem with using WpfApprovals on different versions of the OS. My personal laptop is running Windows 7 Enterprise and the build server is running Windows 7 professional. Since the WpfApprovals is using the OS name in the approval…
user3006539
  • 101
  • 1
  • 3
1
vote
1 answer

CombinationApprovals.VerifyAllCombinations equiavalent using Verify?

Does the Verify library offer Combination Approvals and how would a sample one be implemented? I would like to implement something like: CombinationApprovals.VerifyAllCombinations( DoUpdateQuality, new string[] { "foo", "Aged Brie",…
1
vote
1 answer

com.spun.util.FormattedException: Didn't find cucumber.api.testng.AbstractTestNGCucumberTests under C:\Users\nsyed\Awris2\LearnDatabase

I am using TestRunner class which extends AbstractTestNGCucumberTests to run cucumber feature files in Testng. I have a Issue in the last step where I am using ApprovalTests to verify the response I get from database. I am seeing an…
Arshad
  • 51
  • 4
1
vote
2 answers

How to use ApprovalTests for approving logs

I want to use Approval Tests to verify log output. What is the preferred way to deal with dynamic content of the log text, e.g. time stamps? The included FileApprover always compares the files for exact equality.
Peter Kofler
  • 9,252
  • 8
  • 51
  • 79
1
vote
1 answer

Approval Tests Image comparison with mask

Is it possible to compare two images with a mask for area's that do not need to be compared. I managed to get it working with a basic file comparison [UseReporter(typeof(BeyondCompareReporter))] public void…
Ryan B
  • 681
  • 7
  • 14
1
vote
1 answer

How to use approval tests for testing databases?

I would like to approval-test a result of a database query using classes provided by ApprovalTests.Net library. I understand how approval tests work, but could not find a single example on how to use classes from Persistence namespaces. Would…
Dan
  • 11,077
  • 20
  • 84
  • 119
1
vote
1 answer

Using an abstract base test class with approval tests

Assuming I had a very good reason to want to do the tests below, how could I setup approval tests to name the .approved files UnitTest1.Test1.approved instead of BaseTest.Test1.approved? Thanks public abstract class BaseTest { [TestMethod] …
Z .
  • 12,657
  • 1
  • 31
  • 56
1
vote
1 answer

ApprovalTests - ApprovalMismatchException -

I am writing my first ApprovalTest. I need to understand why I am getting the following error when bothg my files are the same. move /Y "C:\SampleMvc-master\SampleMvc-master\SampleMvc.Tests\Controllers\GoldenMasterTest.About.received.html"…
Chazza
  • 226
  • 3
  • 10