@@ -17,7 +17,6 @@ public void Constructor_InitializesRichTextBoxCorrectly()
1717 [ Fact ]
1818 public void Emit_WithScalarValues_FormatsCorrectly ( )
1919 {
20- // Arrange
2120 var template = _parser . Parse ( "String value: {String}" ) ;
2221 var logEvent = new LogEvent (
2322 DateTimeOffset . Now ,
@@ -26,18 +25,15 @@ public void Emit_WithScalarValues_FormatsCorrectly()
2625 template ,
2726 new [ ] { new LogEventProperty ( "String" , new ScalarValue ( "test" ) ) } ) ;
2827
29- // Act
3028 _renderer . Render ( logEvent , _canvas ) ;
3129
32- // Assert
3330 var text = _richTextBox . Text ;
3431 Assert . Contains ( "String value: test" , text ) ;
3532 }
3633
3734 [ Fact ]
3835 public void Emit_WithDictionaryValue_FormatsCorrectly ( )
3936 {
40- // Arrange
4137 var dict = new Dictionary < string , object >
4238 {
4339 [ "key1" ] = "value1" ,
@@ -59,10 +55,8 @@ public void Emit_WithDictionaryValue_FormatsCorrectly()
5955 template ,
6056 new [ ] { new LogEventProperty ( "Dict" , dictValue ) } ) ;
6157
62- // Act
6358 _renderer . Render ( logEvent , _canvas ) ;
6459
65- // Assert
6660 var text = _richTextBox . Text ;
6761 Assert . Contains ( "Dictionary: {" , text ) ;
6862 Assert . Contains ( "[key1]=value1" , text ) ;
@@ -72,7 +66,6 @@ public void Emit_WithDictionaryValue_FormatsCorrectly()
7266 [ Fact ]
7367 public void Emit_WithSequenceValue_FormatsCorrectly ( )
7468 {
75- // Arrange
7669 var array = new object [ ] { 1 , 2 , 3 , "test" } ;
7770 var sequenceValue = new SequenceValue ( array . Select ( x => new ScalarValue ( x ) ) ) ;
7871
@@ -84,10 +77,8 @@ public void Emit_WithSequenceValue_FormatsCorrectly()
8477 template ,
8578 new [ ] { new LogEventProperty ( "Array" , sequenceValue ) } ) ;
8679
87- // Act
8880 _renderer . Render ( logEvent , _canvas ) ;
8981
90- // Assert
9182 var text = _richTextBox . Text ;
9283 Assert . Contains ( "Array: [" , text ) ;
9384 Assert . Contains ( "1, 2, 3, test" , text ) ;
@@ -96,7 +87,6 @@ public void Emit_WithSequenceValue_FormatsCorrectly()
9687 [ Fact ]
9788 public void Emit_WithStructureValue_FormatsCorrectly ( )
9889 {
99- // Arrange
10090 var structureValue = new StructureValue ( new [ ]
10191 {
10292 new LogEventProperty ( "Name" , new ScalarValue ( "Test" ) ) ,
@@ -112,10 +102,8 @@ public void Emit_WithStructureValue_FormatsCorrectly()
112102 template ,
113103 new [ ] { new LogEventProperty ( "Object" , structureValue ) } ) ;
114104
115- // Act
116105 _renderer . Render ( logEvent , _canvas ) ;
117106
118- // Assert
119107 var text = _richTextBox . Text ;
120108 Assert . Contains ( "Object: {" , text ) ;
121109 Assert . Contains ( "Name=Test" , text ) ;
@@ -126,7 +114,6 @@ public void Emit_WithStructureValue_FormatsCorrectly()
126114 [ Fact ]
127115 public void Emit_WithComplexNestedValue_FormatsCorrectly ( )
128116 {
129- // Arrange
130117 var complex = new StructureValue ( new [ ]
131118 {
132119 new LogEventProperty ( "Name" , new ScalarValue ( "Test" ) ) ,
@@ -146,10 +133,8 @@ public void Emit_WithComplexNestedValue_FormatsCorrectly()
146133 template ,
147134 new [ ] { new LogEventProperty ( "Complex" , complex ) } ) ;
148135
149- // Act
150136 _renderer . Render ( logEvent , _canvas ) ;
151137
152- // Assert
153138 var text = _richTextBox . Text ;
154139 Assert . Contains ( "Complex: {" , text ) ;
155140 Assert . Contains ( "Name=Test" , text ) ;
@@ -162,7 +147,6 @@ public void Emit_WithComplexNestedValue_FormatsCorrectly()
162147 [ Fact ]
163148 public void Emit_WithSequenceValue_JsonFormatting_FormatsCorrectly ( )
164149 {
165- // Arrange
166150 var array = new object [ ] { 1 , 2 , 3 , "test" } ;
167151 var sequenceValue = new SequenceValue ( array . Select ( x => new ScalarValue ( x ) ) ) ;
168152
@@ -174,10 +158,8 @@ public void Emit_WithSequenceValue_JsonFormatting_FormatsCorrectly()
174158 template ,
175159 new [ ] { new LogEventProperty ( "Array" , sequenceValue ) } ) ;
176160
177- // Act
178161 _renderer . Render ( logEvent , _canvas ) ;
179162
180- // Assert
181163 var text = _richTextBox . Text ;
182164 Assert . Contains ( "Array: [" , text ) ;
183165 Assert . Contains ( "1, 2, 3, \" test\" " , text ) ;
@@ -186,7 +168,6 @@ public void Emit_WithSequenceValue_JsonFormatting_FormatsCorrectly()
186168 [ Fact ]
187169 public void Emit_WithNestedSequenceValue_JsonFormatting_FormatsCorrectly ( )
188170 {
189- // Arrange
190171 var nestedArray = new object [ ] { new object [ ] { 1 , 2 } , new object [ ] { 3 , 4 } } ;
191172 var sequenceValue = new SequenceValue ( nestedArray . Select ( x =>
192173 new SequenceValue ( ( ( object [ ] ) x ) . Select ( y => new ScalarValue ( y ) ) ) ) ) ;
@@ -199,10 +180,8 @@ public void Emit_WithNestedSequenceValue_JsonFormatting_FormatsCorrectly()
199180 template ,
200181 new [ ] { new LogEventProperty ( "NestedArray" , sequenceValue ) } ) ;
201182
202- // Act
203183 _renderer . Render ( logEvent , _canvas ) ;
204184
205- // Assert
206185 var text = _richTextBox . Text ;
207186 Assert . Contains ( "NestedArray: [" , text ) ;
208187 Assert . Contains ( "[[1, 2], [3, 4]]" , text ) ;
@@ -211,7 +190,6 @@ public void Emit_WithNestedSequenceValue_JsonFormatting_FormatsCorrectly()
211190 [ Fact ]
212191 public void Emit_WithEmptySequenceValue_JsonFormatting_FormatsCorrectly ( )
213192 {
214- // Arrange
215193 var emptyArray = new object [ ] { } ;
216194 var sequenceValue = new SequenceValue ( emptyArray . Select ( x => new ScalarValue ( x ) ) ) ;
217195
@@ -223,18 +201,15 @@ public void Emit_WithEmptySequenceValue_JsonFormatting_FormatsCorrectly()
223201 template ,
224202 new [ ] { new LogEventProperty ( "EmptyArray" , sequenceValue ) } ) ;
225203
226- // Act
227204 _renderer . Render ( logEvent , _canvas ) ;
228205
229- // Assert
230206 var text = _richTextBox . Text ;
231207 Assert . Contains ( "EmptyArray: []" , text ) ;
232208 }
233209
234210 [ Fact ]
235211 public void Emit_WithStructureValue_JsonFormatting_FormatsCorrectly ( )
236212 {
237- // Arrange
238213 var structureValue = new StructureValue ( new [ ]
239214 {
240215 new LogEventProperty ( "Name" , new ScalarValue ( "Test" ) ) ,
@@ -250,10 +225,8 @@ public void Emit_WithStructureValue_JsonFormatting_FormatsCorrectly()
250225 template ,
251226 new [ ] { new LogEventProperty ( "Object" , structureValue ) } ) ;
252227
253- // Act
254228 _renderer . Render ( logEvent , _canvas ) ;
255229
256- // Assert
257230 var text = _richTextBox . Text ;
258231 Assert . Contains ( "Object: {" , text ) ;
259232 Assert . Contains ( "\" Name\" : \" Test\" " , text ) ;
@@ -264,7 +237,6 @@ public void Emit_WithStructureValue_JsonFormatting_FormatsCorrectly()
264237 [ Fact ]
265238 public void Emit_WithStructureValueWithTypeTag_JsonFormatting_FormatsCorrectly ( )
266239 {
267- // Arrange
268240 var structureValue = new StructureValue (
269241 new [ ]
270242 {
@@ -281,10 +253,8 @@ public void Emit_WithStructureValueWithTypeTag_JsonFormatting_FormatsCorrectly()
281253 template ,
282254 new [ ] { new LogEventProperty ( "Object" , structureValue ) } ) ;
283255
284- // Act
285256 _renderer . Render ( logEvent , _canvas ) ;
286257
287- // Assert
288258 var text = _richTextBox . Text ;
289259 Assert . Contains ( "Object: {" , text ) ;
290260 Assert . Contains ( "\" Name\" : \" Test\" " , text ) ;
@@ -295,9 +265,7 @@ public void Emit_WithStructureValueWithTypeTag_JsonFormatting_FormatsCorrectly()
295265 [ Fact ]
296266 public void Emit_WithEmptyStructureValue_JsonFormatting_FormatsCorrectly ( )
297267 {
298- // Arrange
299268 var structureValue = new StructureValue ( Array . Empty < LogEventProperty > ( ) ) ;
300-
301269 var template = _parser . Parse ( "Object: {@Object:j}" ) ;
302270 var logEvent = new LogEvent (
303271 DateTimeOffset . Now ,
@@ -306,10 +274,8 @@ public void Emit_WithEmptyStructureValue_JsonFormatting_FormatsCorrectly()
306274 template ,
307275 new [ ] { new LogEventProperty ( "Object" , structureValue ) } ) ;
308276
309- // Act
310277 _renderer . Render ( logEvent , _canvas ) ;
311278
312- // Assert
313279 var text = _richTextBox . Text ;
314280 Assert . Contains ( "Object: {}" , text ) ;
315281 }
0 commit comments