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 program uses the File.Exists method to check that the passed filename value is actually present at the specified path. While it works fine when running in the Console App, it fails when setting up a test with VS Test explorer, if the value contains characters like 'ä' or 'ö' (and I suppose it will fail for other special characters) .
I am using .NET 7 and here is the test project setup:
I want to check that a file with name testä.xml exists. I have it in a folder and the relative path to it is ..\..\testä.xml
The method that fails in VS Test explorer is File.Exists .".\..\testä.xml".
It also fails when using dotnet test, that I believe is what VS Test uses under the hood.
Expected behavior
The result of File.Exists "..\..\testä.xml" should be true and the test should then succeed.
Actual behavior
The result of File.Exists ".\..\testä.xml"is false and the test then fails.
Description
The program uses the
File.Exists
method to check that the passed filename value is actually present at the specified path. While it works fine when running in the Console App, it fails when setting up a test with VS Test explorer, if the value contains characters like 'ä' or 'ö' (and I suppose it will fail for other special characters) .I think this issue is identical to this one.
Steps to reproduce
I am using .NET 7 and here is the test project setup:
I want to check that a file with name
testä.xml
exists. I have it in a folder and the relative path to it is..\..\testä.xml
The method that fails in VS Test explorer is
File.Exists .".\..\testä.xml"
.It also fails when using
dotnet test
, that I believe is what VS Test uses under the hood.Expected behavior
The result of
File.Exists "..\..\testä.xml"
should be true and the test should then succeed.Actual behavior
The result of
File.Exists ".\..\testä.xml"
is false and the test then fails.Environment
Windows OS 11
VS 2022
AB#1850367
The text was updated successfully, but these errors were encountered: