@@ -51,8 +51,15 @@ public static void PathIsNullWihtoutRootedAfterArgumentNull()
51
51
}
52
52
53
53
[ Fact ]
54
- [ PlatformSpecific ( PlatformID . Windows ) ]
55
54
public static void ContainsInvalidCharWithoutRootedAfterArgumentNull ( )
55
+ {
56
+ //any path contains invalid character without rooted after (AE)
57
+ CommonCasesException < ArgumentException > ( "ab\0 cd" ) ;
58
+ }
59
+
60
+ [ Fact ]
61
+ [ PlatformSpecific ( PlatformID . Windows ) ]
62
+ public static void ContainsInvalidCharWithoutRootedAfterArgumentNull_Windows ( )
56
63
{
57
64
//any path contains invalid character without rooted after (AE)
58
65
CommonCasesException < ArgumentException > ( "ab\" cd" ) ;
@@ -66,16 +73,23 @@ public static void ContainsInvalidCharWithoutRootedAfterArgumentNull()
66
73
}
67
74
68
75
[ Fact ]
69
- [ PlatformSpecific ( PlatformID . Windows ) ]
70
76
public static void ContainsInvalidCharWithRootedAfterArgumentNull ( )
77
+ {
78
+ //any path contains invalid character with rooted after (AE)
79
+ CommonCasesException < ArgumentException > ( "ab\0 cd" , s_separator + "abc" ) ;
80
+ }
81
+
82
+
83
+ [ Fact ]
84
+ [ PlatformSpecific ( PlatformID . Windows ) ]
85
+ public static void ContainsInvalidCharWithRootedAfterArgumentNull_Windows ( )
71
86
{
72
87
//any path contains invalid character with rooted after (AE)
73
88
CommonCasesException < ArgumentException > ( "ab\" cd" , s_separator + "abc" ) ;
74
89
CommonCasesException < ArgumentException > ( "ab<cd" , s_separator + "abc" ) ;
75
90
CommonCasesException < ArgumentException > ( "ab>cd" , s_separator + "abc" ) ;
76
91
CommonCasesException < ArgumentException > ( "ab|cd" , s_separator + "abc" ) ;
77
92
CommonCasesException < ArgumentException > ( "ab\b cd" , s_separator + "abc" ) ;
78
- CommonCasesException < ArgumentException > ( "ab\0 cd" , s_separator + "abc" ) ;
79
93
CommonCasesException < ArgumentException > ( "ab\t cd" , s_separator + "abc" ) ;
80
94
}
81
95
@@ -110,6 +124,7 @@ public static void PathIsSingleElement()
110
124
{
111
125
//any path is single element
112
126
CommonCases ( "abc" ) ;
127
+ CommonCases ( "abc" + s_separator ) ;
113
128
}
114
129
115
130
[ Fact ]
@@ -119,10 +134,13 @@ public static void PathIsMultipleElements()
119
134
CommonCases ( Path . Combine ( "abc" , Path . Combine ( "def" , "ghi" ) ) ) ;
120
135
}
121
136
122
- public static void NoPathIsRooted ( )
137
+ [ Fact ]
138
+ public static void PathElementsAllSeparated ( )
123
139
{
124
- //no path is rooted
125
- CommonCases ( "abc" ) ;
140
+ Verify ( new string [ ] { "abc" + s_separator , "def" + s_separator } ) ;
141
+ Verify ( new string [ ] { "abc" + s_separator , "def" + s_separator , "ghi" + s_separator } ) ;
142
+ Verify ( new string [ ] { "abc" + s_separator , "def" + s_separator , "ghi" + s_separator , "jkl" + s_separator } ) ;
143
+ Verify ( new string [ ] { "abc" + s_separator , "def" + s_separator , "ghi" + s_separator , "jkl" + s_separator , "mno" + s_separator } ) ;
126
144
}
127
145
128
146
private static void Verify ( string [ ] paths )
0 commit comments