diff --git a/src/Spectre.IO.Tests/Unit/DirectoryPathTests.cs b/src/Spectre.IO.Tests/Unit/DirectoryPathTests.cs index 927bfd6..079dfc1 100644 --- a/src/Spectre.IO.Tests/Unit/DirectoryPathTests.cs +++ b/src/Spectre.IO.Tests/Unit/DirectoryPathTests.cs @@ -3,7 +3,6 @@ using NSubstitute; using Shouldly; using Spectre.IO.Testing; -using Spectre.IO.Testing.Xunit; using Xunit; namespace Spectre.IO.Tests.Unit.IO @@ -12,7 +11,7 @@ public sealed class DirectoryPathTests { public sealed class TheGetDirectoryNameMethod { - [WindowsTheory] + [Theory] [InlineData("C:/Data", "Data")] [InlineData("C:/Data/Work", "Work")] [InlineData("C:/Data/Work/file.txt", "file.txt")] @@ -108,7 +107,7 @@ public void Should_Combine_Paths(string first, string second, string expected) result.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("c:/assets/shaders/", "simple.frag", "c:/assets/shaders/simple.frag")] [InlineData("c:/", "simple.frag", "c:/simple.frag")] [InlineData("c:/assets/shaders/", "test/simple.frag", "c:/assets/shaders/test/simple.frag")] @@ -143,7 +142,7 @@ public void Can_Not_Combine_Directory_Path_With_Absolute_File_Path() .And().Message.ShouldBe("Cannot combine a directory path with an absolute file path."); } - [WindowsFact] + [Fact] public void Can_Not_Combine_Directory_Path_With_Absolute_UNC_File_Path() { // Given @@ -176,7 +175,7 @@ public void Should_Combine_Paths(string first, string second, string expected) result.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("c:/assets/shaders/", "simple", "c:/assets/shaders/simple")] [InlineData("c:/", "simple", "c:/simple")] [InlineData(@"\\", "foo", @"\\foo")] @@ -225,7 +224,7 @@ public void Can_Not_Combine_Directory_Path_With_Absolute_Directory_Path() .And().Message.ShouldBe("Cannot combine a directory path with an absolute directory path."); } - [WindowsTheory] + [Theory] [InlineData("C:/foo/bar")] [InlineData(@"\\foo\bar")] public void Can_Not_Combine_Directory_Path_With_Absolute_Windows_Directory_Path(string input) @@ -290,7 +289,7 @@ public void Should_Create_New_Absolute_Path_Identical_To_The_Path() result.FullPath.ShouldBe("/assets"); } - [WindowsTheory] + [Theory] [InlineData("C:/foo")] [InlineData(@"\\foo")] public void Should_Create_New_Absolute_Windows_Path_Identical_To_The_Path(string fullPath) @@ -403,7 +402,7 @@ public void Should_Collapse_Path_With_Separated_Ellipsis() path.FullPath.ShouldBe("hello/world"); } - [WindowsFact] + [Fact] public void Should_Collapse_Path_With_Windows_Root() { // Given, When @@ -423,7 +422,7 @@ public void Should_Collapse_Path_With_Non_Windows_Root() path.FullPath.ShouldBe("/hello/world"); } - [WindowsFact] + [Fact] public void Should_Stop_Collapsing_When_Windows_Root_Is_Reached() { // Given, When @@ -514,7 +513,7 @@ public sealed class WithDirectoryPath { public sealed class InWindowsFormat { - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C", "C:/A/B/C", ".")] [InlineData("C:/", "C:/", ".")] [InlineData("C:/A/B/C", "C:/A/D/E", "../../D/E")] @@ -539,7 +538,7 @@ public void Should_Returns_Relative_Path_Between_Paths(string from, string to, s relativePath.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C", "D:/A/B/C")] [InlineData("C:/A/B", "D:/E/")] [InlineData("C:/", "B:/")] @@ -559,7 +558,7 @@ public void Should_Throw_If_No_Relative_Path_Can_Be_Found(string from, string to .And().Message.ShouldBe("Paths must share a common prefix."); } - [WindowsFact] + [Fact] public void Should_Throw_If_Target_DirectoryPath_Is_Null() { // Given @@ -573,7 +572,7 @@ public void Should_Throw_If_Target_DirectoryPath_Is_Null() .And().ParamName.ShouldBe("to"); } - [WindowsFact] + [Fact] public void Should_Throw_If_Source_DirectoryPath_Is_Relative() { // Given @@ -587,7 +586,7 @@ public void Should_Throw_If_Source_DirectoryPath_Is_Relative() .And().Message.ShouldBe("Source path must be an absolute path."); } - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C")] [InlineData(@"\\A\B\C")] public void Should_Throw_If_Target_DirectoryPath_Is_Relative(string input) @@ -690,7 +689,7 @@ public sealed class WithFilePath { public sealed class InWindowsFormat { - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C", "C:/A/B/C/hello.txt", "hello.txt")] [InlineData("C:/", "C:/hello.txt", "hello.txt")] [InlineData("C:/A/B/C", "C:/A/D/E/hello.txt", "../../D/E/hello.txt")] @@ -714,7 +713,7 @@ public void Should_Returns_Relative_Path_Between_Paths(string from, string to, s relativePath.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C", "D:/A/B/C/hello.txt")] [InlineData("C:/A/B", "D:/E/hello.txt")] [InlineData("C:/", "B:/hello.txt")] @@ -734,7 +733,7 @@ public void Should_Throw_If_No_Relative_Path_Can_Be_Found(string from, string to .And().Message.ShouldBe("Paths must share a common prefix."); } - [WindowsFact] + [Fact] public void Should_Throw_If_Target_FilePath_Is_Null() { // Given @@ -748,7 +747,7 @@ public void Should_Throw_If_Target_FilePath_Is_Null() .And().ParamName.ShouldBe("to"); } - [WindowsFact] + [Fact] public void Should_Throw_If_Source_DirectoryPath_Is_Relative() { // Given @@ -762,7 +761,7 @@ public void Should_Throw_If_Source_DirectoryPath_Is_Relative() .And().Message.ShouldBe("Source path must be an absolute path."); } - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C")] [InlineData(@"\\A\B\C")] public void Should_Throw_If_Target_FilePath_Is_Relative(string input) diff --git a/src/Spectre.IO.Tests/Unit/FilePathTests.cs b/src/Spectre.IO.Tests/Unit/FilePathTests.cs index 6e4124b..56e1cd4 100644 --- a/src/Spectre.IO.Tests/Unit/FilePathTests.cs +++ b/src/Spectre.IO.Tests/Unit/FilePathTests.cs @@ -2,7 +2,6 @@ using NSubstitute; using Shouldly; using Spectre.IO.Testing; -using Spectre.IO.Testing.Xunit; using Xunit; namespace Spectre.IO.Tests.Unit.IO @@ -26,7 +25,7 @@ public void Can_See_If_A_Path_Has_An_Extension(string fullPath, bool expected) path.HasExtension.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/foo/bar/baz.txt", true)] [InlineData("C:/foo/bar/baz", false)] [InlineData("C:/foo/bar.baz/qux", false)] @@ -65,7 +64,7 @@ public void Can_Get_Extension(string fullPath, string expected) result.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/foo/bar/baz.txt", ".txt")] [InlineData("C:/foo/bar/baz.txt/qux.md", ".md")] [InlineData("C:/foo/bar/baz.txt/qux.md.rs", ".rs")] @@ -109,7 +108,7 @@ public void Should_Remove_Extension(string fullPath, string expected) result.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/foo/bar/baz.txt", "C:/foo/bar/baz")] [InlineData("C:/foo/bar/baz.txt/qux.md", "C:/foo/bar/baz.txt/qux")] [InlineData("C:/foo/bar/baz.txt/qux.md.rs", "C:/foo/bar/baz.txt/qux.md")] @@ -149,7 +148,7 @@ public void Can_Get_Directory_For_File_Path(string input, string expected) result.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/temp/hello.txt", "C:/temp")] [InlineData(@"\\temp\hello.txt", @"\\temp")] public void Can_Get_Directory_For_Windows_File_Path(string fullPath, string expected) @@ -190,7 +189,7 @@ public void Can_Get_Directory_For_Absolute_File_Path_In_Root() result.FullPath.ShouldBe("/"); } - [WindowsTheory] + [Theory] [InlineData("C:/hello.txt", "C:/")] [InlineData(@"\\hello.txt", @"\\")] public void Can_Get_Directory_For_Absolute_File_Path_In_Windows_Root(string fullPath, string expected) @@ -227,7 +226,7 @@ public void Can_Change_Extension_Of_Path(string input, string extension, string path.ToString().ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/temp/hello.txt", ".dat", "C:/temp/hello.dat")] [InlineData("C:/temp/hello", ".dat", "C:/temp/hello.dat")] [InlineData("C:/", ".dat", "C:/.dat")] @@ -278,7 +277,7 @@ public void Can_Append_Extension_To_Path(string extension, string expected) path.ToString().ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/temp/hello.txt", ".dat", "C:/temp/hello.txt.dat")] [InlineData(@"\\temp\hello.txt", ".dat", @"\\temp\hello.txt.dat")] public void Can_Append_Extension_To_Windows_Path(string fullPath, string extension, string expected) @@ -318,7 +317,7 @@ public void Can_Get_Filename_From_Path(string input, string expected) result.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/input/test.txt", "test.txt")] [InlineData("C:/input/test.foo.txt", "test.foo.txt")] [InlineData("C:/input/test", "test")] @@ -367,7 +366,7 @@ public void Should_Return_Filename_Without_Extension_From_Path(string fullPath, result.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/input/test.txt", "test")] [InlineData("C:/input/test.foo.txt", "test.foo")] [InlineData("C:/input/test", "test")] @@ -442,7 +441,7 @@ public void Should_Return_Same_File_Path_If_File_Path_Is_Absolute(string expecte result.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/foo/bar.txt")] [InlineData(@"\\foo\bar.txt")] public void Should_Create_New_Absolute_Windows_Path_Identical_To_The_Path(string expected) @@ -558,7 +557,7 @@ public void Should_Collapse_Path_With_Separated_Ellipsis() path.FullPath.ShouldBe("hello/world/foo.txt"); } - [WindowsFact] + [Fact] public void Should_Collapse_Path_With_Windows_Root() { // Given, When @@ -578,7 +577,7 @@ public void Should_Collapse_Path_With_Non_Windows_Root() path.FullPath.ShouldBe("/hello/world/foo.txt"); } - [WindowsFact] + [Fact] public void Should_Stop_Collapsing_When_Windows_Root_Is_Reached() { // Given, When @@ -669,7 +668,7 @@ public sealed class WithDirectoryPath { public sealed class InWindowsFormat { - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C/hello.txt", "C:/A/B/C", ".")] [InlineData("C:/hello.txt", "C:/", ".")] [InlineData("C:/A/B/C/hello.txt", "C:/A/D/E", "../../D/E")] @@ -694,7 +693,7 @@ public void Should_Returns_Relative_Path_Between_Paths(string from, string to, s relativePath.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C/hello.txt", "D:/A/B/C")] [InlineData("C:/A/B/hello.txt", "D:/E/")] [InlineData("C:/hello.txt", "B:/")] @@ -714,7 +713,7 @@ public void Should_Throw_If_No_Relative_Path_Can_Be_Found(string from, string to .And().Message.ShouldBe("Paths must share a common prefix."); } - [WindowsFact] + [Fact] public void Should_Throw_If_Target_DirectoryPath_Is_Null() { // Given @@ -728,7 +727,7 @@ public void Should_Throw_If_Target_DirectoryPath_Is_Null() .And().ParamName.ShouldBe("to"); } - [WindowsFact] + [Fact] public void Should_Throw_If_Source_DirectoryPath_Is_Relative() { // Given @@ -742,7 +741,7 @@ public void Should_Throw_If_Source_DirectoryPath_Is_Relative() .And().Message.ShouldBe("Source path must be an absolute path."); } - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C/hello.txt")] [InlineData(@"\\A\B\C\hello.txt")] public void Should_Throw_If_Target_DirectoryPath_Is_Relative(string input) @@ -845,7 +844,7 @@ public sealed class WithFilePath { public sealed class InWindowsFormat { - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C/hello.txt", "C:/A/B/C/hello.txt", "hello.txt")] [InlineData("C:/hello.txt", "C:/hello.txt", "hello.txt")] [InlineData("C:/hello.txt", "C:/world.txt", "world.txt")] @@ -872,7 +871,7 @@ public void Should_Returns_Relative_Path_Between_Paths(string from, string to, s relativePath.FullPath.ShouldBe(expected); } - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C/hello.txt", "D:/A/B/C/hello.txt")] [InlineData("C:/A/B/hello.txt", "D:/E/hello.txt")] [InlineData("C:/hello.txt", "B:/hello.txt")] @@ -892,7 +891,7 @@ public void Should_Throw_If_No_Relative_Path_Can_Be_Found(string from, string to .And().Message.ShouldBe("Paths must share a common prefix."); } - [WindowsFact] + [Fact] public void Should_Throw_If_Target_FilePath_Is_Null() { // Given @@ -906,7 +905,7 @@ public void Should_Throw_If_Target_FilePath_Is_Null() .And().ParamName.ShouldBe("to"); } - [WindowsFact] + [Fact] public void Should_Throw_If_Source_DirectoryPath_Is_Relative() { // Given @@ -920,7 +919,7 @@ public void Should_Throw_If_Source_DirectoryPath_Is_Relative() .And().Message.ShouldBe("Source path must be an absolute path."); } - [WindowsTheory] + [Theory] [InlineData("C:/A/B/C/hello.txt")] [InlineData(@"\\A\B\C\hello.txt")] public void Should_Throw_If_Target_FilePath_Is_Relative(string input) diff --git a/src/Spectre.IO.Tests/Unit/Globbing/UncGlobberTests.cs b/src/Spectre.IO.Tests/Unit/Globbing/UncGlobberTests.cs index 2be7b6c..880b06d 100644 --- a/src/Spectre.IO.Tests/Unit/Globbing/UncGlobberTests.cs +++ b/src/Spectre.IO.Tests/Unit/Globbing/UncGlobberTests.cs @@ -1,5 +1,4 @@ using Shouldly; -using Spectre.IO.Testing.Xunit; using Spectre.IO.Tests.Fixtures; using Xunit; @@ -7,7 +6,7 @@ namespace Spectre.IO.Tests.Unit.IO.Globbing { public sealed class UncGlobberTests { - [WindowsFact] + [Fact] public void Should_Return_Files_And_Folders_For_Pattern_Ending_With_Wildcard() { // Given @@ -35,7 +34,7 @@ public void Should_Return_Files_And_Folders_For_Pattern_Ending_With_Wildcard() result.ShouldContainFilePath(@"\\Server\Bar\Qux.h"); } - [WindowsFact] + [Fact] public void Should_Throw_If_No_Share_Name_Has_Been_Specified() { // Given @@ -49,7 +48,7 @@ public void Should_Throw_If_No_Share_Name_Has_Been_Specified() result.Message.ShouldBe(@"The pattern '\\' has no server part specified."); } - [WindowsTheory] + [Theory] [InlineData(@"\\fo?")] [InlineData(@"\\fo*")] [InlineData(@"\\fo?\bar")] @@ -67,7 +66,7 @@ public void Should_Throw_If_Invalid_Share_Name_Has_Been_Specified(string input) result.Message.ShouldBe($"The pattern '{input}' has an invalid server part specified."); } - [WindowsFact] + [Fact] public void Can_Traverse_Recursively() { // Given @@ -85,7 +84,7 @@ public void Can_Traverse_Recursively() result.ShouldContainFilePath(@"\\Server\Bar\Qux.c"); } - [WindowsFact] + [Fact] public void Should_Be_Able_To_Visit_Parent_Using_Double_Dots() { // Given @@ -99,7 +98,7 @@ public void Should_Be_Able_To_Visit_Parent_Using_Double_Dots() result.ShouldContainFilePath(@"\\Server\Foo\Bar\Qux.c"); } - [WindowsFact] + [Fact] public void Should_Return_Single_Path_For_Absolute_File_Path_Without_Glob_Pattern() { // Given @@ -113,7 +112,7 @@ public void Should_Return_Single_Path_For_Absolute_File_Path_Without_Glob_Patter result.ShouldContainFilePath(@"\\Server\Foo\Bar\Qux.c"); } - [WindowsFact] + [Fact] public void Should_Return_Single_Path_For_Absolute_Directory_Path_Without_Glob_Pattern() { // Given @@ -127,7 +126,7 @@ public void Should_Return_Single_Path_For_Absolute_Directory_Path_Without_Glob_P result.ShouldContainDirectoryPath(@"\\Server\Foo\Bar"); } - [WindowsFact] + [Fact] public void Should_Return_Files_And_Folders_For_Pattern_Containing_Wildcard() { // Given @@ -142,7 +141,7 @@ public void Should_Return_Files_And_Folders_For_Pattern_Containing_Wildcard() result.ShouldContainFilePath(@"\\Server\Foo\Baz\Qux.c"); } - [WindowsFact] + [Fact] public void Should_Return_Files_And_Folders_For_Pattern_Ending_With_Character_Wildcard() { // Given @@ -157,7 +156,7 @@ public void Should_Return_Files_And_Folders_For_Pattern_Ending_With_Character_Wi result.ShouldContainFilePath(@"\\Server\Foo\Bar\Qex.c"); } - [WindowsFact] + [Fact] public void Should_Return_Files_And_Folders_For_Pattern_Containing_Character_Wildcard() { // Given @@ -172,7 +171,7 @@ public void Should_Return_Files_And_Folders_For_Pattern_Containing_Character_Wil result.ShouldContainFilePath(@"\\Server\Foo\Baz\Qux.c"); } - [WindowsFact] + [Fact] public void Should_Return_Files_For_Pattern_Ending_With_Character_Wildcard_And_Dot() { // Given @@ -187,7 +186,7 @@ public void Should_Return_Files_For_Pattern_Ending_With_Character_Wildcard_And_D result.ShouldContainFilePath(@"\\Server\Bar.Qux.Test.dll"); } - [WindowsFact] + [Fact] public void Should_Return_File_For_Recursive_Wildcard_Pattern_Ending_With_Wildcard_Regex() { // Given @@ -205,7 +204,7 @@ public void Should_Return_File_For_Recursive_Wildcard_Pattern_Ending_With_Wildca result.ShouldContainFilePath(@"\\Server\Bar\Qux.c"); } - [WindowsFact] + [Fact] public void Should_Return_Only_Folders_For_Pattern_Ending_With_Recursive_Wildcard() { // Given @@ -224,7 +223,7 @@ public void Should_Return_Only_Folders_For_Pattern_Ending_With_Recursive_Wildcar result.ShouldContainDirectoryPath(@"\\Server\Bar"); } - [WindowsFact] + [Fact] public void Should_Include_Files_In_Root_Folder_When_Using_Recursive_Wildcard() { // Given @@ -238,7 +237,7 @@ public void Should_Include_Files_In_Root_Folder_When_Using_Recursive_Wildcard() result.ShouldContainFilePath(@"\\Foo\Bar.baz"); } - [WindowsFact] + [Fact] public void Should_Include_Folder_In_Root_Folder_When_Using_Recursive_Wildcard() { // Given @@ -252,7 +251,7 @@ public void Should_Include_Folder_In_Root_Folder_When_Using_Recursive_Wildcard() result.ShouldContainDirectoryPath(@"\\Foo\Bar"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_Parenthesis_In_Them() { // Given @@ -266,7 +265,7 @@ public void Should_Parse_Glob_Expressions_With_Parenthesis_In_Them() result.ShouldContainFilePath(@"\\Foo (Bar)\Baz.c"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_AtSign_In_Them() { // Given @@ -280,7 +279,7 @@ public void Should_Parse_Glob_Expressions_With_AtSign_In_Them() result.ShouldContainFilePath(@"\\Foo@Bar\Baz.c"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_Relative_Directory_Not_At_The_Beginning() { // Given @@ -295,7 +294,7 @@ public void Should_Parse_Glob_Expressions_With_Relative_Directory_Not_At_The_Beg result.ShouldContainFilePath(@"\\Server\Bar.Qux.Test.dll"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_Unicode_Characters_And_Ending_With_Identifier() { // Given @@ -309,7 +308,7 @@ public void Should_Parse_Glob_Expressions_With_Unicode_Characters_And_Ending_Wit result.ShouldContainFilePath(@"\\嵌套\目录\文件.延期"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_Unicode_Characters_And_Not_Ending_With_Identifier() { // Given diff --git a/src/Spectre.IO.Tests/Unit/Globbing/WindowsGlobberTests.cs b/src/Spectre.IO.Tests/Unit/Globbing/WindowsGlobberTests.cs index f7fc242..6a703cd 100644 --- a/src/Spectre.IO.Tests/Unit/Globbing/WindowsGlobberTests.cs +++ b/src/Spectre.IO.Tests/Unit/Globbing/WindowsGlobberTests.cs @@ -1,6 +1,6 @@ using Shouldly; -using Spectre.IO.Testing.Xunit; using Spectre.IO.Tests.Fixtures; +using Xunit; namespace Spectre.IO.Tests.Unit.IO.Globbing { @@ -8,7 +8,7 @@ public sealed class WindowsGlobberTests { public sealed class TheMatchMethod { - [WindowsFact] + [Fact] public void Will_Fix_Root_If_Drive_Is_Missing_By_Using_The_Drive_From_The_Working_Directory() { // Given @@ -22,7 +22,7 @@ public void Will_Fix_Root_If_Drive_Is_Missing_By_Using_The_Drive_From_The_Workin result.ShouldContainFilePath("C:/Working/Foo/Bar/Qux.c"); } - [WindowsFact] + [Fact] public void Should_Ignore_Case_Sensitivity_On_Case_Insensitive_Operative_System() { // Given @@ -36,7 +36,7 @@ public void Should_Ignore_Case_Sensitivity_On_Case_Insensitive_Operative_System( result.ShouldContainFilePath("C:/Working/Foo/Bar/Qux.c"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_Parenthesis_In_Them() { // Given @@ -50,7 +50,7 @@ public void Should_Parse_Glob_Expressions_With_Parenthesis_In_Them() result.ShouldContainFilePath("C:/Program Files (x86)/Foo.c"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_Ampersand_In_Them() { // Given @@ -64,7 +64,7 @@ public void Should_Parse_Glob_Expressions_With_Ampersand_In_Them() result.ShouldContainFilePath("C:/Tools & Services/MyTool.dll"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_Plus_In_Them() { // Given @@ -78,7 +78,7 @@ public void Should_Parse_Glob_Expressions_With_Plus_In_Them() result.ShouldContainFilePath("C:/Tools + Services/MyTool.dll"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_Percent_In_Them() { // Given @@ -92,7 +92,7 @@ public void Should_Parse_Glob_Expressions_With_Percent_In_Them() result.ShouldContainFilePath("C:/Some %2F Directory/MyTool.dll"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_Exclamation_In_Them() { // Given @@ -106,7 +106,7 @@ public void Should_Parse_Glob_Expressions_With_Exclamation_In_Them() result.ShouldContainFilePath("C:/Some ! Directory/MyTool.dll"); } - [WindowsFact] + [Fact] public void Should_Parse_Glob_Expressions_With_AtSign_In_Them() { // Given @@ -120,7 +120,7 @@ public void Should_Parse_Glob_Expressions_With_AtSign_In_Them() result.ShouldContainFilePath("C:/Some@Directory/MyTool.dll"); } - [WindowsFact] + [Fact] public void Should_Return_Files_For_Pattern_Ending_With_Character_Wildcard_And_Dot_On_Windows() { // Given @@ -135,7 +135,7 @@ public void Should_Return_Files_For_Pattern_Ending_With_Character_Wildcard_And_D result.ShouldContainFilePath("C:/Working/Project.B.Test.dll"); } - [WindowsFact] + [Fact] public void Should_Return_Files_And_Folders_For_Pattern_Containing_Bracket_Wildcard_On_Windows() { // Given @@ -150,7 +150,7 @@ public void Should_Return_Files_And_Folders_For_Pattern_Containing_Bracket_Wildc result.ShouldContainFilePath("C:/Working/foobaz.rs"); } - [WindowsFact] + [Fact] public void Should_Return_Files_And_Folders_For_Pattern_Containing_Brace_Expansion_On_Windows() { // Given @@ -165,7 +165,7 @@ public void Should_Return_Files_And_Folders_For_Pattern_Containing_Brace_Expansi result.ShouldContainFilePath("C:/Working/foobax.rs"); } - [WindowsFact] + [Fact] public void Should_Return_Files_And_Folders_For_Pattern_Containing_Negated_Bracket_Wildcard_On_Windows() { // Given diff --git a/src/Spectre.IO.Tests/Unit/PathTests.cs b/src/Spectre.IO.Tests/Unit/PathTests.cs index 786dce0..8f910fb 100644 --- a/src/Spectre.IO.Tests/Unit/PathTests.cs +++ b/src/Spectre.IO.Tests/Unit/PathTests.cs @@ -1,5 +1,4 @@ using Shouldly; -using Spectre.IO.Testing.Xunit; using Xunit; namespace Spectre.IO.Tests.Unit.IO @@ -212,7 +211,7 @@ public void An_UNC_Path_Is_Always_Considered_To_Be_Absolute() path.IsRelative.ShouldBeFalse(); } - [WindowsTheory] + [Theory] [InlineData("c:/assets/shaders", false)] [InlineData("c:/assets/shaders/basic.frag", false)] [InlineData("c:/", false)] diff --git a/src/Spectre.IO.Tests/Utilities/WindowsFactAttribute.cs b/src/Spectre.IO.Tests/Utilities/WindowsFactAttribute.cs deleted file mode 100644 index d345cc4..0000000 --- a/src/Spectre.IO.Tests/Utilities/WindowsFactAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Spectre.IO.Internal; -using Xunit; - -namespace Spectre.IO.Testing.Xunit -{ - public sealed class WindowsFactAttribute : FactAttribute - { - private static readonly PlatformFamily _family = EnvironmentHelper.GetPlatformFamily(); - - public WindowsFactAttribute(string reason = null) - { - if (_family != PlatformFamily.Windows) - { - Skip = reason ?? "Windows test."; - } - } - } -} \ No newline at end of file diff --git a/src/Spectre.IO.Tests/Utilities/WindowsTheoryAttribute.cs b/src/Spectre.IO.Tests/Utilities/WindowsTheoryAttribute.cs deleted file mode 100644 index ebf09e3..0000000 --- a/src/Spectre.IO.Tests/Utilities/WindowsTheoryAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Spectre.IO.Internal; -using Xunit; - -namespace Spectre.IO.Testing.Xunit -{ - public sealed class WindowsTheoryAttribute : TheoryAttribute - { - private static readonly PlatformFamily _family = EnvironmentHelper.GetPlatformFamily(); - - public WindowsTheoryAttribute(string reason = null) - { - if (_family != PlatformFamily.Windows) - { - Skip = reason ?? "Windows test."; - } - } - } -} \ No newline at end of file diff --git a/src/Spectre.IO/Internal/PathHelper.cs b/src/Spectre.IO/Internal/PathHelper.cs index b62d3e5..0710b60 100644 --- a/src/Spectre.IO/Internal/PathHelper.cs +++ b/src/Spectre.IO/Internal/PathHelper.cs @@ -9,8 +9,6 @@ internal static class PathHelper private const char Slash = '/'; private const string UncPrefix = @"\\"; - private static readonly bool _isWindows = EnvironmentHelper.GetPlatformFamily() == PlatformFamily.Windows; - public static string Combine(params string[] paths) { if (paths.Length == 0) @@ -280,13 +278,10 @@ public static bool IsPathRooted(string path) } } - if (_isWindows) + // Windows drive? + if (length >= 2 && path[1] == ':') { - // Windows drive? - if (length >= 2 && path[1] == ':') - { - return true; - } + return true; } }