diff options
author | Alexander Radchenko <radchenkosasha@gmail.com> | 2018-03-23 18:31:34 +0300 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2018-03-23 18:31:34 +0300 |
commit | 544f3c2afcfb096f59e678fbf8a7ce8938be72c9 (patch) | |
tree | c2b70f5923ca14c16ecc1c829731a4aa9a01d914 | |
parent | 243eee1e5183abb3c05f50ae2c00f33a2e4b9d95 (diff) |
Fixed netfx System.IO.FileSystem.Tests fails on non-English Windows (#28313)
-rw-r--r-- | src/System.IO.FileSystem/tests/FileStream/Name.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/System.IO.FileSystem/tests/FileStream/Name.cs b/src/System.IO.FileSystem/tests/FileStream/Name.cs index 88fe39c402..d4dde6ed22 100644 --- a/src/System.IO.FileSystem/tests/FileStream/Name.cs +++ b/src/System.IO.FileSystem/tests/FileStream/Name.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.Globalization; using System.IO; using Xunit; @@ -39,11 +40,16 @@ namespace System.IO.Tests [Fact] public void NameReturnsUnknownForHandle() { - using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite)) - using (FileStream fsh = new FileStream(fs.SafeFileHandle, FileAccess.ReadWrite)) + RemoteInvoke(() => { - Assert.Equal("[Unknown]", fsh.Name); - } + CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture; + + using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite)) + using (FileStream fsh = new FileStream(fs.SafeFileHandle, FileAccess.ReadWrite)) + { + Assert.Equal("[Unknown]", fsh.Name); + } + }).Dispose(); } } } |