@@ -26,7 +26,7 @@ public DirectoryInfoAssertions(DirectoryInfo dir)
26
26
public AndConstraint < DirectoryInfoAssertions > Exist ( )
27
27
{
28
28
Execute . Assertion . ForCondition ( _dirInfo . Exists )
29
- . FailWith ( "Expected directory {0} does not exist." , _dirInfo . FullName ) ;
29
+ . FailWith ( String . Format ( "Expected directory {0} does not exist." , _dirInfo . FullName ) ) ;
30
30
return new AndConstraint < DirectoryInfoAssertions > ( this ) ;
31
31
}
32
32
@@ -71,7 +71,7 @@ public AndConstraint<DirectoryInfoAssertions> NotHaveFile(
71
71
Execute . Assertion
72
72
. ForCondition ( file == null )
73
73
. BecauseOf ( because , reasonArgs )
74
- . FailWith ( "File {0} should not be found in directory {1}." , expectedFile , _dirInfo . FullName ) ;
74
+ . FailWith ( String . Format ( "File {0} should not be found in directory {1}." , expectedFile , _dirInfo . FullName ) ) ;
75
75
return new AndConstraint < DirectoryInfoAssertions > ( this ) ;
76
76
}
77
77
@@ -109,8 +109,8 @@ public AndConstraint<DirectoryInfoAssertions> HaveFilesMatching(
109
109
Execute . Assertion
110
110
. ForCondition ( matchingFileExists == true )
111
111
. BecauseOf ( because , reasonArgs )
112
- . FailWith ( "Expected directory {0} to contain files matching {1}, but no matching file exists." ,
113
- _dirInfo . FullName , expectedFilesSearchPattern ) ;
112
+ . FailWith ( String . Format ( "Expected directory {0} to contain files matching {1}, but no matching file exists." ,
113
+ _dirInfo . FullName , expectedFilesSearchPattern ) ) ;
114
114
115
115
return new AndConstraint < DirectoryInfoAssertions > ( this ) ;
116
116
}
@@ -132,16 +132,16 @@ public AndConstraint<DirectoryInfoAssertions> NotHaveFilesMatching(string expect
132
132
{
133
133
var matchingFileCount = _dirInfo . EnumerateFiles ( expectedFilesSearchPattern , searchOption ) . Count ( ) ;
134
134
Execute . Assertion . ForCondition ( matchingFileCount == 0 )
135
- . FailWith ( "Found {0} files that should not exist in directory {1}. No file matching {2} should exist." ,
136
- matchingFileCount , _dirInfo . FullName , expectedFilesSearchPattern ) ;
135
+ . FailWith ( String . Format ( "Found {0} files that should not exist in directory {1}. No file matching {2} should exist." ,
136
+ matchingFileCount , _dirInfo . FullName , expectedFilesSearchPattern ) ) ;
137
137
return new AndConstraint < DirectoryInfoAssertions > ( this ) ;
138
138
}
139
139
140
140
public AndConstraint < DirectoryInfoAssertions > HaveDirectory ( string expectedDir )
141
141
{
142
142
var dir = _dirInfo . EnumerateDirectories ( expectedDir , SearchOption . TopDirectoryOnly ) . SingleOrDefault ( ) ;
143
143
Execute . Assertion . ForCondition ( dir != null )
144
- . FailWith ( "Expected directory {0} cannot be found inside directory {1}." , expectedDir , _dirInfo . FullName ) ;
144
+ . FailWith ( String . Format ( "Expected directory {0} cannot be found inside directory {1}." , expectedDir , _dirInfo . FullName ) ) ;
145
145
146
146
return new AndConstraint < DirectoryInfoAssertions > ( new DirectoryInfoAssertions ( dir ) ) ;
147
147
}
@@ -160,7 +160,7 @@ public AndConstraint<DirectoryInfoAssertions> NotHaveDirectory(string unexpected
160
160
{
161
161
var dir = _dirInfo . EnumerateDirectories ( unexpectedDir , SearchOption . TopDirectoryOnly ) . SingleOrDefault ( ) ;
162
162
Execute . Assertion . ForCondition ( dir == null )
163
- . FailWith ( "Directory {0} should not be found in directory {1}." , unexpectedDir , _dirInfo . FullName ) ;
163
+ . FailWith ( String . Format ( "Directory {0} should not be found in directory {1}." , unexpectedDir , _dirInfo . FullName ) ) ;
164
164
165
165
return new AndConstraint < DirectoryInfoAssertions > ( new DirectoryInfoAssertions ( dir ) ) ;
166
166
}
0 commit comments