1- using LogExpert ;
1+ using System . Text ;
22
3- using NUnit . Framework ;
3+ using ColumnizerLib ;
44
5- using System ;
6- using System . Text ;
5+ using NUnit . Framework ;
76
8- namespace ColumnizerLib . UnitTests ;
7+ namespace LogExpert . ColumnizerLib . Tests ;
98
109[ TestFixture ]
1110public class ColumnTests
1211{
1312 [ SetUp ]
14- public void SetUp ( )
13+ public void SetUp ( )
1514 {
1615 // Reset to default before each test
1716 Column . SetMaxDisplayLength ( 20_000 ) ;
1817 }
1918
2019 [ Test ]
21- public void Column_DisplayMaxLength_DefaultIs20000 ( )
20+ public void Column_DisplayMaxLength_DefaultIs20000 ( )
2221 {
2322 Assert . That ( Column . GetMaxDisplayLength ( ) , Is . EqualTo ( 20_000 ) ) ;
2423 }
2524
2625 [ Test ]
27- public void Column_DisplayMaxLength_CanBeConfigured ( )
26+ public void Column_DisplayMaxLength_CanBeConfigured ( )
2827 {
2928 Column . SetMaxDisplayLength ( 50_000 ) ;
3029 Assert . That ( Column . GetMaxDisplayLength ( ) , Is . EqualTo ( 50_000 ) ) ;
31-
30+
3231 // Reset for other tests
3332 Column . SetMaxDisplayLength ( 20_000 ) ;
3433 }
3534
3635 [ Test ]
37- public void Column_DisplayMaxLength_EnforcesMinimum ( )
36+ public void Column_DisplayMaxLength_EnforcesMinimum ( )
3837 {
39- Assert . Throws < ArgumentOutOfRangeException > ( ( ) => Column . SetMaxDisplayLength ( 500 ) ) ;
38+ _ = Assert . Throws < ArgumentOutOfRangeException > ( ( ) => Column . SetMaxDisplayLength ( 500 ) ) ;
4039 }
4140
4241 [ Test ]
43- public void Column_TruncatesAtConfiguredDisplayLength ( )
42+ public void Column_TruncatesAtConfiguredDisplayLength ( )
4443 {
4544 Column . SetMaxDisplayLength ( 10_000 ) ;
46-
45+
4746 // Create a line longer than the display max length
4847 var longValue = new StringBuilder ( ) . Append ( 'X' , 15_000 ) . ToString ( ) ;
49-
48+
5049 Column column = new ( )
5150 {
5251 FullValue = longValue
@@ -55,21 +54,21 @@ public void Column_TruncatesAtConfiguredDisplayLength()
5554 // FullValue should contain the full line
5655 Assert . That ( column . FullValue , Is . EqualTo ( longValue ) ) ;
5756 Assert . That ( column . FullValue . Length , Is . EqualTo ( 15_000 ) ) ;
58-
57+
5958 // DisplayValue should be truncated at 10,000 with "..." appended
6059 Assert . That ( column . DisplayValue . Length , Is . EqualTo ( 10_003 ) ) ; // 10000 + "..."
61- Assert . That ( column . DisplayValue . EndsWith ( "..." ) , Is . True ) ;
62- Assert . That ( column . DisplayValue . StartsWith ( "XXX" ) , Is . True ) ;
63-
60+ Assert . That ( column . DisplayValue . EndsWith ( "..." , StringComparison . OrdinalIgnoreCase ) , Is . True ) ;
61+ Assert . That ( column . DisplayValue . StartsWith ( "XXX" , StringComparison . OrdinalIgnoreCase ) , Is . True ) ;
62+
6463 // Reset for other tests
6564 Column . SetMaxDisplayLength ( 20_000 ) ;
6665 }
6766
6867 [ Test ]
69- public void Column_NoTruncationWhenBelowLimit ( )
68+ public void Column_NoTruncationWhenBelowLimit ( )
7069 {
7170 Column . SetMaxDisplayLength ( 20_000 ) ;
72-
71+
7372 var normalValue = new StringBuilder ( ) . Append ( 'Y' , 5_000 ) . ToString ( ) ;
7473 Column column = new ( )
7574 {
@@ -81,14 +80,15 @@ public void Column_NoTruncationWhenBelowLimit()
8180 }
8281
8382 [ Test ]
84- public void Column_NullCharReplacement ( )
83+ public void Column_NullCharReplacement ( )
8584 {
86- Column column = new ( ) ;
87-
88- column . FullValue = "asdf\0 " ;
85+ Column column = new ( )
86+ {
87+ FullValue = "asdf\0 "
88+ } ;
8989
9090 //Switch between the different implementation for the windows versions
91- //Not that great solution but currently I'm out of ideas, I know that currently
91+ //Not that great solution but currently I'm out of ideas, I know that currently
9292 //only one implementation depending on the windows version is executed
9393 if ( Environment . Version >= Version . Parse ( "6.2" ) )
9494 {
@@ -103,11 +103,12 @@ public void Column_NullCharReplacement()
103103 }
104104
105105 [ Test ]
106- public void Column_TabReplacement ( )
106+ public void Column_TabReplacement ( )
107107 {
108- Column column = new ( ) ;
109-
110- column . FullValue = "asdf\t " ;
108+ Column column = new ( )
109+ {
110+ FullValue = "asdf\t "
111+ } ;
111112
112113 Assert . That ( column . DisplayValue , Is . EqualTo ( "asdf " ) ) ;
113114 Assert . That ( column . FullValue , Is . EqualTo ( "asdf\t " ) ) ;
0 commit comments