You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a test case that consists of a for loop. In each iteration, an operation is performed and its result is compared to a snapshot. The name of the snapshot is dynamically created in each loop.
[Fact]publicvoidIterativeTest(){conststringnameBase="TestCase";for(vari=0;i<2;i++){varcontents=$"this is iteration = {i}";varname=$"{nameBase}_{i}";
Snapshot.Match(contents, Snapshot.FullName(SnapshotNameExtension.Create(name)));}}
When I run this test with version 0.5.2, the files are created and compared as expected. When I upgrade to 0.5.4, the test case fails because in the second iteration, the contents are compared to the file of the first iteration.
In 0.5.2
i = 0: name = "TestCase_0", contents are compared to TestCase_0.snap -> successful
i = 1: name = "TestCase_1", contents are compared to TestCase_1.snap -> successful
-> test succeeds
In 0.5.4
i = 0: name = "TestCase_0", contents are compared to TestCase_0.snap -> successful
i = 1: name = "TestCase_1", contents are compared to TestCase_0.snap -> fails
-> test fails
To Reproduce
Steps to reproduce the behavior:
Add the test case I posted above
Run with 0.5.2, will work
Run with 0.5.4, will fail
Expected behavior
The test case should not fail.
Desktop (please complete the following information):
OS: macOS Catalina
Version: 10.15.5
The text was updated successfully, but these errors were encountered:
Describe the bug
We have a test case that consists of a for loop. In each iteration, an operation is performed and its result is compared to a snapshot. The name of the snapshot is dynamically created in each loop.
When I run this test with version 0.5.2, the files are created and compared as expected. When I upgrade to 0.5.4, the test case fails because in the second iteration, the contents are compared to the file of the first iteration.
In 0.5.2
i = 0
:name = "TestCase_0"
, contents are compared toTestCase_0.snap
-> successfuli = 1
:name = "TestCase_1"
, contents are compared toTestCase_1.snap
-> successfulIn 0.5.4
i = 0
:name = "TestCase_0"
, contents are compared toTestCase_0.snap
-> successfuli = 1
:name = "TestCase_1"
, contents are compared toTestCase_0.snap
-> failsTo Reproduce
Steps to reproduce the behavior:
Expected behavior
The test case should not fail.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: