@@ -36,13 +36,14 @@ public void Given_ValidDirectoryPath_Should_ReturnDirectoryPath()
36
36
Assert . That ( resultPath , Is . EqualTo ( testPath ) ) ;
37
37
}
38
38
39
- [ Test ]
40
- public void Given_DirectoryPathWithIncorrectCase_Should_ReturnCorrectedDirectoryPath ( )
39
+ [ TestCase ( "raw/database/JAN" ) ]
40
+ [ TestCase ( "raw/DataBase/jan" ) ]
41
+ [ TestCase ( "RAW/database/jan" ) ]
42
+ public void Given_DirectoryPathWithIncorrectCase_Should_ReturnCorrectedDirectoryPath ( string testPath )
41
43
{
42
- var testPath = "raw/DATABASE" ;
43
44
var resultPath = Sut . CheckPathAsync ( testPath , true ) . Result ;
44
45
45
- Assert . That ( resultPath , Is . EqualTo ( "raw/database" ) ) ;
46
+ Assert . That ( resultPath , Is . EqualTo ( "raw/database/jan " ) ) ;
46
47
}
47
48
48
49
[ Test ]
@@ -64,10 +65,11 @@ public void Given_FilePathWithIncorrectFilenameCase_Should_ReturnCorrectedFilePa
64
65
}
65
66
66
67
67
- [ Test ]
68
- public void Given_FilePathWithIncorrectDirectoryCase_Should_ReturnCorrectedFilePath ( )
68
+ [ TestCase ( "raw/database/JAN/extract_1.csv" ) ]
69
+ [ TestCase ( "raw/DataBase/jan/extract_1.csv" ) ]
70
+ [ TestCase ( "RAW/database/jan/extract_1.csv" ) ]
71
+ public void Given_FilePathWithIncorrectDirectoryCase_Should_ReturnCorrectedFilePath ( string testPath )
69
72
{
70
- var testPath = "raw/database/JAN/extract_1.csv" ;
71
73
var resultPath = Sut . CheckPathAsync ( testPath , false ) . Result ;
72
74
73
75
Assert . That ( resultPath , Is . EqualTo ( "raw/database/jan/extract_1.csv" ) ) ;
@@ -109,11 +111,10 @@ public void Given_InvalidFilePath_Should_ReturnNull()
109
111
Assert . That ( resultPath , Is . EqualTo ( null ) ) ;
110
112
}
111
113
112
- [ Test ]
113
- public void Given_DirectoryPathWithIncorrectCase_When_MatchesMultiplePaths_Should_Throw ( )
114
+ [ TestCase ( "raw/aPi" ) ]
115
+ [ TestCase ( "RAW/api" ) ]
116
+ public void Given_DirectoryPathWithIncorrectCase_When_MatchesMultiplePaths_Should_Throw ( string testPath )
114
117
{
115
- var testPath = "raw/aPi" ;
116
-
117
118
Assert . CatchAsync ( ( ) => Sut . CheckPathAsync ( testPath , true ) ) ;
118
119
}
119
120
@@ -153,29 +154,23 @@ public void Given_ForwardSlashPath_Should_Return_EmptyString()
153
154
Assert . That ( resultPath , Is . EqualTo ( string . Empty ) ) ;
154
155
}
155
156
156
- [ Test ]
157
- public void Given_DirectoryPathWithIncorrectCase_Should_ThrowWhenMultipleDirectoriesMatch ( )
157
+ [ TestCase ( "RaW/api/jan" ) ]
158
+ [ TestCase ( "raw/ApI/jan" ) ]
159
+ [ TestCase ( "raw/api/JaN" ) ]
160
+ public void Given_DirectoryPathWithIncorrectCase_Should_ThrowWhenMultipleDirectoriesMatch ( string testPath )
158
161
{
159
- var testPath = "RaW/api/jan" ;
160
-
161
162
var exception = Assert . CatchAsync ( ( ) => Sut . CheckPathAsync ( testPath , true ) ) ;
162
163
Assert . That ( exception , Is . TypeOf ( typeof ( Exception ) ) ) ;
163
164
}
164
165
165
- [ Test ]
166
- public void Given_FilePathWithIncorrectCase_Should_ThrowWhenMultipleDirectoriesMatch ( )
166
+ [ TestCase ( "RaW/api/jan/delta_extract_1.json" ) ]
167
+ [ TestCase ( "raw/ApI/jan/delta_extract_1.json" ) ]
168
+ [ TestCase ( "raw/api/JaN/delta_extract_1.json" ) ]
169
+ [ TestCase ( "raw/api/jan/delta_EXTRACT_1.json" ) ]
170
+ [ TestCase ( "raw/DataBase/feb/extract_2.csv" ) ]
171
+ [ TestCase ( "raw/database/feb/Extract_2.csv" ) ]
172
+ public void Given_PathWithIncorrectCase_Should_ThrowWhenMultipleFilesMatch ( string testPath )
167
173
{
168
- var testPath = "RaW/api/jan/delta_extract_1.json" ;
169
-
170
- var exception = Assert . CatchAsync ( ( ) => Sut . CheckPathAsync ( testPath , false ) ) ;
171
- Assert . That ( exception , Is . TypeOf ( typeof ( Exception ) ) ) ;
172
- }
173
-
174
- [ Test ]
175
- public void Given_FilePathWithIncorrectCase_Should_ThrowWhenMultipleFilesMatch ( )
176
- {
177
- var testPath = "raw/database/feb/Extract_2.csv" ;
178
-
179
174
var exception = Assert . CatchAsync ( ( ) => Sut . CheckPathAsync ( testPath , false ) ) ;
180
175
Assert . That ( exception , Is . TypeOf ( typeof ( Exception ) ) ) ;
181
176
}
0 commit comments