File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System . Text ;
2+ using NFluent ;
3+ using ReClassNET . Extensions ;
4+ using Xunit ;
5+
6+ namespace ReClass . NET_Tests . Extensions
7+ {
8+ public class StringBuilderExtensionTest
9+ {
10+ [ Fact ]
11+ public void TestPrependChar ( )
12+ {
13+ var sut = new StringBuilder ( "test" ) ;
14+ sut . Prepend ( 'x' ) ;
15+
16+ Check . That ( sut . ToString ( ) ) . IsEqualTo ( "xtest" ) ;
17+ }
18+
19+ [ Theory ]
20+ [ InlineData ( null ) ]
21+ [ InlineData ( "" ) ]
22+ [ InlineData ( "test" ) ]
23+ public void TestPrependString ( string value )
24+ {
25+ var sut = new StringBuilder ( "test" ) ;
26+ sut . Prepend ( value ) ;
27+
28+ Check . That ( sut . ToString ( ) ) . IsEqualTo ( value + "test" ) ;
29+ }
30+ }
31+ }
Original file line number Diff line number Diff line change 1+ using System . IO ;
2+ using NFluent ;
3+ using ReClassNET . Extensions ;
4+ using Xunit ;
5+
6+ namespace ReClass . NET_Tests . Extensions
7+ {
8+ public class StringReaderExtensionTest
9+ {
10+ [ Theory ]
11+ [ InlineData ( "" , - 1 ) ]
12+ [ InlineData ( " " , - 1 ) ]
13+ [ InlineData ( "\t " , - 1 ) ]
14+ [ InlineData ( "\r " , - 1 ) ]
15+ [ InlineData ( "\n " , - 1 ) ]
16+ [ InlineData ( "x" , ( int ) 'x' ) ]
17+ [ InlineData ( "x " , ( int ) 'x' ) ]
18+ [ InlineData ( " x" , ( int ) 'x' ) ]
19+ [ InlineData ( " x" , ( int ) 'x' ) ]
20+ [ InlineData ( "\t x " , ( int ) 'x' ) ]
21+ [ InlineData ( "\r x " , ( int ) 'x' ) ]
22+ [ InlineData ( "\n x " , ( int ) 'x' ) ]
23+ public void TestReadSkipWhitespaces ( string input , int expected )
24+ {
25+ using ( var sut = new StringReader ( input ) )
26+ {
27+ Check . That ( sut . ReadSkipWhitespaces ( ) ) . IsEqualTo ( expected ) ;
28+ }
29+ }
30+ }
31+ }
Original file line number Diff line number Diff line change 7272 <Compile Include =" Extensions\EncodingExtensionTest.cs" />
7373 <Compile Include =" Extensions\FloatingPointExtensionTest.cs" />
7474 <Compile Include =" Extensions\LinqExtensionTests.cs" />
75+ <Compile Include =" Extensions\StringBuilderExtensionTest.cs" />
7576 <Compile Include =" Extensions\StringExtensionTest.cs" />
77+ <Compile Include =" Extensions\StringReaderExtensionTest.cs" />
7678 <Compile Include =" Properties\AssemblyInfo.cs" />
7779 <Compile Include =" Util\CircularBufferTest.cs" />
7880 <Compile Include =" Util\CommandLineArgsTest.cs" />
You can’t perform that action at this time.
0 commit comments