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
The Nunit test runner can not handle apostrophes in string parameter values. After building the project, the test explorer shows different test cases than expected. Instead of the Input of the TestCaseSource Tim'sHouse you'll see a test EnterTest("Tim\'sHouse").
In my case this completly wastes the important test case, and i'll have to correct the input arguments afterwords in the procedure. It would be great, when the test explorer would not longer add apostrophs to the strings, or at least, if the escapes would be removed, before the test run starts.
string[]myPasswords=new String[]{"Tim'sHouse"};[Test][TestCaseSource("myPasswords")]publicvoidEnterPassword(stringpassword){//here the input parameter for password is >>Tim\'sBar<<.
Assert.AreEqual("Tim\\'sHouse",password);// (You) Shall not pass!
Assert.AreEqual(myPasswords[0], password);//This should compare the input value to the input value, however this fails!}
Do you know any workaround for this case?
Best regards,
StarWars999123
The text was updated successfully, but these errors were encountered:
The original Nunit 2 Adapter. However, the same issue appears, if I use the Nunit-GUI of the Visual Studio project. I also changed the string to string[] mypasswords=new String[] {@"'"};
However, Nunit (2.6.4.14350) still adds an slash before and discovers the test as EnterPassword("\'")!
The original Nunit 2 Adapter, however. The same issue appears, if I use the Nunit-GUI of the Visual Studio project. I also changed the string to >>string[] mypasswords=new String[] {@"'"};<<.
However, Nunit (2.6.4.14350) still adds an slash before and discovers the test as >>EnterPassword("'")<<!
—
Reply to this email directly or view it on GitHub.
This error has been fixed in the NUnit3 adapter. It should be trviial to fix this in the the 2. adapter.
Repro solution here https://github.com/OsirisTerje/NUnit.Issues in the Issue90 folder
This comes from the underlying engine, in NUnit3 it is fixed, in NUnit 2.X it is not. We can modify in the adapter but there must be some rule for doing that, we don't want to remove intentional '', but I would assume it would then add double-backslashes,.so the rule can be to delete single backslashes.
The Nunit test runner can not handle apostrophes in string parameter values. After building the project, the test explorer shows different test cases than expected. Instead of the Input of the TestCaseSource
Tim'sHouse
you'll see a testEnterTest("Tim\'sHouse")
.In my case this completly wastes the important test case, and i'll have to correct the input arguments afterwords in the procedure. It would be great, when the test explorer would not longer add apostrophs to the strings, or at least, if the escapes would be removed, before the test run starts.
Do you know any workaround for this case?
Best regards,
StarWars999123
The text was updated successfully, but these errors were encountered: