Questions tagged [verify-tests]

Verify is a snapshot tool that simplifies the assertion of complex data models and documents.

Verify is a snapshot tool that simplifies the assertion of complex data models and documents. Verify is called on the test result during the assertion phase. It serializes that result and stores it in a file that matches the test name. On the next test execution, the result is again serialized and compared to the existing file. The test will fail if the two snapshots do not match: either the change is unexpected, or the reference snapshot needs to be updated to the new result.

https://github.com/VerifyTests/Verify

11 questions
2
votes
1 answer

How to format HTML returned by Verify.PlayWright for better comparison

I am using Verify.PlayWright and to take HTML element snapshots. When the compare opens, all the HTML is on one line. This makes it hard to see the differences. Is there a way to format the HTML in order to get a nicer comparison? var root = await…
1
vote
1 answer

How to Verify (VerifyTests) a private member of a class

I want to Verify a class, but it does not have any public members. Here is the class: public class SpreadsheetValuesList { private readonly List _spreadsheetValues = new(); public SpreadsheetValuesList(string json) { …
Jess
  • 23,901
  • 21
  • 124
  • 145
1
vote
2 answers

Is there a way to scrub (inline) Guids from JSON properties?

My code generates a mapping in JSON where the property names are inline Guids. When verifying the output it always generates a new result, because the Guids in the property names are not scrubbed. [Test] public Task GuidIsScrubbed() { const…
Tobias Meyer
  • 345
  • 1
  • 3
  • 10
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",…
0
votes
1 answer

Why is my Verify.Bunit test failing and not producing a received file?

I am using the Verify.Xunit and Verify.Bunit packages in my test project but they have started failing and I can't figure out why. Example simple test - just renders a component: [Fact] public Task TestInputBaseRendering_Default() { //Arrange:…
Mister Magoo
  • 7,452
  • 1
  • 20
  • 35
0
votes
0 answers

How to clean up not used *.verified.txt files when using VerifyTests?

I am using VerifyTests/Verify The name of *.verified.txt files are based on the test case method names, and optionally the .UseParameters() setting. However, test method names or .UseParameters() values could change via refactoring, or implementing…
g.pickardou
  • 32,346
  • 36
  • 123
  • 268
0
votes
1 answer

Can we ignore scrubbing for selective DateTime fields, when using VerifyTests library?

This question is about Verify testing library. It srubs date fields by default. Here is the official link. It also provides a way to disable this behavior for a given object, by using DontScrubDateTimes() method. Is there a way to disable the…
user1451111
  • 1,735
  • 3
  • 18
  • 30
0
votes
0 answers

Use Verify snapshot package to test round tripped XML serialization

I'd like to use Verify to test that a deserilized test XML document can be re-serialized and matches the original test document. Given that the test document is the 'gold' version to test against is there a simple way to say verify against this…
JohnGoldsmith
  • 2,638
  • 14
  • 26
0
votes
1 answer

Is there a way to scrub a value for a specific property?

Apologies if this is documented somewhere, but I was unable to find it. I have this nested shortId field { ... "positions" [ { .... "shortId": ABC123 }, ] } I need to scrub it the same way guids are…
0
votes
1 answer

Verify a PDF byte array with Verify.ImageMagick

With Verify.ImageMagick, it's possible to verify PDF files by them being converted to images which are then diffed. The default is naturally to compare files on disk, but I would like to verify a byte array. As I can't use ImplicitUsings, I have the…
Asbjørn Ulsberg
  • 8,721
  • 3
  • 45
  • 61
0
votes
1 answer

Does "VerifyTests / Verify" have global settings?

@Simon (https://stackoverflow.com/users/53158/simon) In the docs it is mentioned how to setup a custom output directory for Verify and it works fine, but it is pain to do it for every test. await Verify("value") …
mihails.kuzmins
  • 1,140
  • 1
  • 11
  • 19