2
2
using FluentAssertions ;
3
3
using Xunit ;
4
4
5
- namespace Serilog . Formatting . Log4Net . Tests
5
+ namespace Serilog . Formatting . Log4Net . Tests ;
6
+
7
+ public class IndentationSettingsTest
6
8
{
7
- public class IndentationSettingsTest
9
+ [ Theory ]
10
+ [ InlineData ( Indentation . Space , 2 , " " ) ]
11
+ [ InlineData ( Indentation . Tab , 2 , "\t \t " ) ]
12
+ [ InlineData ( Indentation . Space , 4 , " " ) ]
13
+ [ InlineData ( Indentation . Tab , 4 , "\t \t \t \t " ) ]
14
+ public void IndentationSettingsToString ( Indentation indentation , byte size , string expectedString )
15
+ {
16
+ // Arrange
17
+ var indentationSettings = new IndentationSettings ( indentation , size ) ;
18
+
19
+ // Act
20
+ var indentationString = indentationSettings . ToString ( ) ;
21
+
22
+ // Assert
23
+ indentationString . Should ( ) . Be ( expectedString ) ;
24
+ }
25
+
26
+ [ Fact ]
27
+ public void InvalidIndentation ( )
8
28
{
9
- [ Theory ]
10
- [ InlineData ( Indentation . Space , 2 , " " ) ]
11
- [ InlineData ( Indentation . Tab , 2 , "\t \t " ) ]
12
- [ InlineData ( Indentation . Space , 4 , " " ) ]
13
- [ InlineData ( Indentation . Tab , 4 , "\t \t \t \t " ) ]
14
- public void IndentationSettingsToString ( Indentation indentation , byte size , string expectedString )
15
- {
16
- // Arrange
17
- var indentationSettings = new IndentationSettings ( indentation , size ) ;
18
-
19
- // Act
20
- var indentationString = indentationSettings . ToString ( ) ;
21
-
22
- // Assert
23
- indentationString . Should ( ) . Be ( expectedString ) ;
24
- }
25
-
26
- [ Fact ]
27
- public void InvalidIndentation ( )
28
- {
29
- // Act
30
- Func < IndentationSettings > action = ( ) => new IndentationSettings ( ( Indentation ) ( - 1 ) , size : 1 ) ;
31
-
32
- // Assert
33
- action . Should ( ) . ThrowExactly < ArgumentOutOfRangeException > ( )
34
- . Which . Message . Should ( ) . StartWith ( "The value of argument 'indentation' (-1) is invalid for enum type 'Indentation'." ) ;
35
- }
36
-
37
- [ Fact ]
38
- public void InvalidSize ( )
39
- {
40
- // Act
41
- Func < IndentationSettings > action = ( ) => new IndentationSettings ( indentation : default , size : 0 ) ;
42
-
43
- // Assert
44
- action . Should ( ) . ThrowExactly < ArgumentOutOfRangeException > ( )
45
- . Which . Message . Should ( ) . StartWith ( "The value of argument 'size' must be greater than 0." ) ;
46
- }
29
+ // Act
30
+ var action = ( ) => new IndentationSettings ( ( Indentation ) ( - 1 ) , size : 1 ) ;
31
+
32
+ // Assert
33
+ action . Should ( ) . ThrowExactly < ArgumentOutOfRangeException > ( )
34
+ . Which . Message . Should ( ) . StartWith ( "The value of argument 'indentation' (-1) is invalid for enum type 'Indentation'." ) ;
35
+ }
36
+
37
+ [ Fact ]
38
+ public void InvalidSize ( )
39
+ {
40
+ // Act
41
+ var action = ( ) => new IndentationSettings ( indentation : default , size : 0 ) ;
42
+
43
+ // Assert
44
+ action . Should ( ) . ThrowExactly < ArgumentOutOfRangeException > ( )
45
+ . Which . Message . Should ( ) . StartWith ( "The value of argument 'size' must be greater than 0." ) ;
47
46
}
48
47
}
0 commit comments