1
- using System ;
2
- using System . Collections . Generic ;
1
+ using FluentAssertions ;
2
+
3
3
using System . CommandLine . Builder ;
4
4
using System . CommandLine . Invocation ;
5
5
using System . CommandLine . Parsing ;
6
6
using System . Linq ;
7
- using System . Text ;
8
7
using System . Threading . Tasks ;
9
8
10
9
using Xunit ;
@@ -26,7 +25,7 @@ public static async Task Sets_environment_variable_to_value()
26
25
Handler = CommandHandler . Create ( ( ) =>
27
26
{
28
27
asserted = true ;
29
- Assert . Equal ( value , Environment . GetEnvironmentVariable ( variable ) ) ;
28
+ Environment . GetEnvironmentVariable ( variable ) . Should ( ) . Be ( value ) ;
30
29
} )
31
30
} ;
32
31
@@ -36,7 +35,7 @@ public static async Task Sets_environment_variable_to_value()
36
35
37
36
await parser . InvokeAsync ( new [ ] { $ "[env:{ variable } ={ value } ]" } ) ;
38
37
39
- Assert . True ( asserted ) ;
38
+ asserted . Should ( ) . BeTrue ( ) ;
40
39
}
41
40
42
41
[ Fact ]
@@ -50,7 +49,7 @@ public static async Task Trims_environment_variable_name()
50
49
Handler = CommandHandler . Create ( ( ) =>
51
50
{
52
51
asserted = true ;
53
- Assert . Equal ( value , Environment . GetEnvironmentVariable ( variable ) ) ;
52
+ Environment . GetEnvironmentVariable ( variable ) . Should ( ) . Be ( value ) ;
54
53
} )
55
54
} ;
56
55
@@ -60,7 +59,7 @@ public static async Task Trims_environment_variable_name()
60
59
61
60
await parser . InvokeAsync ( new [ ] { $ "[env: { variable } ={ value } ]" } ) ;
62
61
63
- Assert . True ( asserted ) ;
62
+ asserted . Should ( ) . BeTrue ( ) ;
64
63
}
65
64
66
65
[ Fact ]
@@ -74,7 +73,7 @@ public static async Task Trims_environment_variable_value()
74
73
Handler = CommandHandler . Create ( ( ) =>
75
74
{
76
75
asserted = true ;
77
- Assert . Equal ( value , Environment . GetEnvironmentVariable ( variable ) ) ;
76
+ Environment . GetEnvironmentVariable ( variable ) . Should ( ) . Be ( value ) ;
78
77
} )
79
78
} ;
80
79
@@ -84,7 +83,7 @@ public static async Task Trims_environment_variable_value()
84
83
85
84
await parser . InvokeAsync ( new [ ] { $ "[env:{ variable } = { value } ]" } ) ;
86
85
87
- Assert . True ( asserted ) ;
86
+ asserted . Should ( ) . BeTrue ( ) ;
88
87
}
89
88
90
89
[ Fact ]
@@ -98,7 +97,7 @@ public static async Task Sets_environment_variable_value_containing_equals_sign(
98
97
Handler = CommandHandler . Create ( ( ) =>
99
98
{
100
99
asserted = true ;
101
- Assert . Equal ( value , Environment . GetEnvironmentVariable ( variable ) ) ;
100
+ Environment . GetEnvironmentVariable ( variable ) . Should ( ) . Be ( value ) ;
102
101
} )
103
102
} ;
104
103
@@ -108,7 +107,7 @@ public static async Task Sets_environment_variable_value_containing_equals_sign(
108
107
109
108
await parser . InvokeAsync ( new [ ] { $ "[env:{ variable } ={ value } ]" } ) ;
110
109
111
- Assert . True ( asserted ) ;
110
+ asserted . Should ( ) . BeTrue ( ) ;
112
111
}
113
112
114
113
[ Fact ]
@@ -121,7 +120,7 @@ public static async Task Ignores_environment_directive_without_equals_sign()
121
120
Handler = CommandHandler . Create ( ( ) =>
122
121
{
123
122
asserted = true ;
124
- Assert . Null ( Environment . GetEnvironmentVariable ( variable ) ) ;
123
+ Environment . GetEnvironmentVariable ( variable ) . Should ( ) . BeNull ( ) ;
125
124
} )
126
125
} ;
127
126
@@ -131,7 +130,7 @@ public static async Task Ignores_environment_directive_without_equals_sign()
131
130
132
131
await parser . InvokeAsync ( new [ ] { $ "[env:{ variable } ]" } ) ;
133
132
134
- Assert . True ( asserted ) ;
133
+ asserted . Should ( ) . BeTrue ( ) ;
135
134
}
136
135
137
136
[ Fact ]
@@ -145,7 +144,7 @@ public static async Task Ignores_environment_directive_with_empty_variable_name(
145
144
{
146
145
asserted = true ;
147
146
var env = Environment . GetEnvironmentVariables ( ) ;
148
- Assert . DoesNotContain ( value , env . Values . Cast < string > ( ) . ToArray ( ) ) ;
147
+ env . Values . Cast < string > ( ) . Should ( ) . NotContain ( value ) ;
149
148
} )
150
149
} ;
151
150
@@ -155,7 +154,7 @@ public static async Task Ignores_environment_directive_with_empty_variable_name(
155
154
156
155
await parser . InvokeAsync ( new [ ] { $ "[env:={ value } ]" } ) ;
157
156
158
- Assert . True ( asserted ) ;
157
+ asserted . Should ( ) . BeTrue ( ) ;
159
158
}
160
159
161
160
[ Fact ]
@@ -169,7 +168,7 @@ public static async Task Ignores_environment_directive_with_whitespace_variable_
169
168
{
170
169
asserted = true ;
171
170
var env = Environment . GetEnvironmentVariables ( ) ;
172
- Assert . DoesNotContain ( value , env . Values . Cast < string > ( ) . ToArray ( ) ) ;
171
+ env . Values . Cast < string > ( ) . Should ( ) . NotContain ( value ) ;
173
172
} )
174
173
} ;
175
174
@@ -179,7 +178,7 @@ public static async Task Ignores_environment_directive_with_whitespace_variable_
179
178
180
179
await parser . InvokeAsync ( new [ ] { $ "[env: ={ value } ]" } ) ;
181
180
182
- Assert . True ( asserted ) ;
181
+ asserted . Should ( ) . BeTrue ( ) ;
183
182
}
184
183
}
185
184
}
0 commit comments