This repository was archived by the owner on Aug 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7474 </Reference >
7575 </ItemGroup >
7676 <ItemGroup >
77+ <Compile Include =" LineReplacer.cs" />
7778 <Compile Include =" Properties\AssemblyInfo.cs" />
7879 <Compile Include =" ReferenceVisitorTests.cs" />
7980 </ItemGroup >
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . IO ;
3+ using MbUnit . Framework ;
4+
5+ namespace CassetteHelperTests
6+ {
7+ [ TestFixture ]
8+ public class LineReplacerTests
9+ {
10+ [ Test , ExpectedException ( typeof ( FileNotFoundException ) ) ]
11+ public void IfFileDoesNotExistThrowsFileNotFoundException ( )
12+ {
13+ new LineReplacer ( "test.js" ) ;
14+ }
15+
16+ [ Test , ExpectedArgumentNullException ( "filePath" ) ]
17+ [ Row ( "" ) ]
18+ [ Row ( null ) ]
19+ public void NullOrEmptyFilePathThrowsArgumentNullException ( string filePath )
20+ {
21+ new LineReplacer ( filePath ) ;
22+ }
23+ }
24+
25+ public class LineReplacer
26+ {
27+ public LineReplacer ( string filePath )
28+ {
29+ if ( string . IsNullOrEmpty ( filePath ) ) throw new ArgumentNullException ( "filePath" ) ;
30+ if ( ! File . Exists ( filePath ) ) throw new FileNotFoundException ( "Could not find file to replace lines in" , filePath ) ;
31+ }
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . IO ;
3+ using MbUnit . Framework ;
4+
5+ namespace CassetteHelperTests
6+ {
7+ [ TestFixture ]
8+ public class LineReplacerTests
9+ {
10+ [ Test , ExpectedException ( typeof ( FileNotFoundException ) ) ]
11+ public void IfFileDoesNotExistThrowsFileNotFoundException ( )
12+ {
13+ new LineReplacer ( "test.js" ) ;
14+ }
15+
16+ [ Test , ExpectedArgumentNullException ( "filePath" ) ]
17+ [ Row ( "" ) ]
18+ [ Row ( null ) ]
19+ public void NullOrEmptyFilePathThrowsArgumentNullException ( string filePath )
20+ {
21+ new LineReplacer ( filePath ) ;
22+ }
23+ }
24+
25+ public class LineReplacer
26+ {
27+ public LineReplacer ( string filePath )
28+ {
29+ if ( string . IsNullOrEmpty ( filePath ) ) throw new ArgumentNullException ( "filePath" ) ;
30+ if ( ! File . Exists ( filePath ) ) throw new FileNotFoundException ( "Could not find file to replace lines in" , filePath ) ;
31+ }
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments