@@ -13,12 +13,13 @@ namespace System.CommandLine.Tests
13
13
public class EnvironmentVariableDirectiveTests
14
14
{
15
15
private static readonly Random randomizer = new Random ( Seed : 456476756 ) ;
16
+ private readonly string test_variable = $ "TEST_ENVIRONMENT_VARIABLE{ randomizer . Next ( ) } ";
16
17
17
18
[ Fact ]
18
- public static async Task Sets_environment_variable_to_value ( )
19
+ public async Task Sets_environment_variable_to_value ( )
19
20
{
20
21
bool asserted = false ;
21
- string variable = $ "TEST_ENVIRONMENT_VARIABLE { randomizer . Next ( ) } " ;
22
+ string variable = test_variable ;
22
23
const string value = "This is a test" ;
23
24
var rootCommand = new RootCommand
24
25
{
@@ -39,10 +40,10 @@ public static async Task Sets_environment_variable_to_value()
39
40
}
40
41
41
42
[ Fact ]
42
- public static async Task Trims_environment_variable_name ( )
43
+ public async Task Trims_environment_variable_name ( )
43
44
{
44
45
bool asserted = false ;
45
- string variable = $ "TEST_ENVIRONMENT_VARIABLE { randomizer . Next ( ) } " ;
46
+ string variable = test_variable ;
46
47
const string value = "This is a test" ;
47
48
var rootCommand = new RootCommand
48
49
{
@@ -63,10 +64,10 @@ public static async Task Trims_environment_variable_name()
63
64
}
64
65
65
66
[ Fact ]
66
- public static async Task Trims_environment_variable_value ( )
67
+ public async Task Trims_environment_variable_value ( )
67
68
{
68
69
bool asserted = false ;
69
- string variable = $ "TEST_ENVIRONMENT_VARIABLE { randomizer . Next ( ) } " ;
70
+ string variable = test_variable ;
70
71
const string value = "This is a test" ;
71
72
var rootCommand = new RootCommand
72
73
{
@@ -87,10 +88,10 @@ public static async Task Trims_environment_variable_value()
87
88
}
88
89
89
90
[ Fact ]
90
- public static async Task Sets_environment_variable_value_containing_equals_sign ( )
91
+ public async Task Sets_environment_variable_value_containing_equals_sign ( )
91
92
{
92
93
bool asserted = false ;
93
- string variable = $ "TEST_ENVIRONMENT_VARIABLE { randomizer . Next ( ) } " ;
94
+ string variable = test_variable ;
94
95
const string value = "This is = a test containing equals" ;
95
96
var rootCommand = new RootCommand
96
97
{
@@ -111,10 +112,10 @@ public static async Task Sets_environment_variable_value_containing_equals_sign(
111
112
}
112
113
113
114
[ Fact ]
114
- public static async Task Ignores_environment_directive_without_equals_sign ( )
115
+ public async Task Ignores_environment_directive_without_equals_sign ( )
115
116
{
116
117
bool asserted = false ;
117
- string variable = $ "TEST_ENVIRONMENT_VARIABLE { randomizer . Next ( ) } " ;
118
+ string variable = test_variable ;
118
119
var rootCommand = new RootCommand
119
120
{
120
121
Handler = CommandHandler . Create ( ( ) =>
0 commit comments