@@ -48,12 +48,11 @@ public void TestNotSupplied(Type destinationType, object expectedValue)
48
48
public void TestEnvironmentVariables ( string parameter , Type destinationType , object expectedValue )
49
49
{
50
50
var service = GetService (
51
- new [ ]
52
- {
51
+ [
53
52
"-arg1" ,
54
53
"value1" ,
55
54
"-switch1"
56
- } ,
55
+ ] ,
57
56
new Dictionary < string , string >
58
57
{
59
58
{ "arg1" , "value2" } ,
@@ -68,15 +67,14 @@ public void TestEnvironmentVariables(string parameter, Type destinationType, obj
68
67
public void TestExpression ( )
69
68
{
70
69
var service = GetService (
71
- new [ ]
72
- {
70
+ [
73
71
"--string" ,
74
72
"--set" ,
75
73
"1" ,
76
74
"2" ,
77
75
"3" ,
78
76
"--interface-param"
79
- } ) ;
77
+ ] ) ;
80
78
81
79
var build = new TestBuild ( ) ;
82
80
@@ -98,12 +96,12 @@ public void TestValueSet()
98
96
{
99
97
var build = new TestBuild ( ) ;
100
98
var verbosities = new [ ]
101
- {
102
- ( nameof ( Verbosity . Minimal ) , Verbosity . Minimal ) ,
103
- ( nameof ( Verbosity . Normal ) , Verbosity . Normal ) ,
104
- ( nameof ( Verbosity . Quiet ) , Verbosity . Quiet ) ,
105
- ( nameof ( Verbosity . Verbose ) , Verbosity . Verbose ) ,
106
- } ;
99
+ {
100
+ ( nameof ( Verbosity . Minimal ) , Verbosity . Minimal ) ,
101
+ ( nameof ( Verbosity . Normal ) , Verbosity . Normal ) ,
102
+ ( nameof ( Verbosity . Quiet ) , Verbosity . Quiet ) ,
103
+ ( nameof ( Verbosity . Verbose ) , Verbosity . Verbose ) ,
104
+ } ;
107
105
ParameterService . GetParameterValueSet ( GetMemberInfo ( ( ) => NukeBuild . Verbosity ) , instance : null )
108
106
. Should ( ) . BeEquivalentTo ( verbosities ) ;
109
107
ParameterService . GetParameterValueSet ( GetMemberInfo ( ( ) => build . Verbosities ) , instance : null )
@@ -118,13 +116,13 @@ public void TestPrecedence()
118
116
119
117
var environmentVariables = new Dictionary < string , string > { [ "string" ] = "environmentVariables" } ;
120
118
var commandLineArguments = new ArgumentParser ( "--string commandLine" ) ;
121
- var parameterFileArguments = new ArgumentParser ( "-- string parameterFile") ;
119
+ var parameterFileArguments = new Func < string , Type , object > ( ( _ , _ ) => " parameterFile") ;
122
120
var commitMessageArguments = new ArgumentParser ( "--string commitMessage" ) ;
123
121
124
122
var service = new ParameterService ( ( ) => emptyArguments , ( ) => emptyEnvironmentVariables )
125
- {
126
- ArgumentsFromFilesService = parameterFileArguments
127
- } ;
123
+ {
124
+ ArgumentsFromFilesService = parameterFileArguments
125
+ } ;
128
126
service . GetParameter ( "string" , typeof ( string ) , separator : null ) . Should ( ) . Be ( "parameterFile" ) ;
129
127
130
128
service = new ParameterService ( ( ) => emptyArguments , ( ) => environmentVariables ) { ArgumentsFromFilesService = parameterFileArguments } ;
@@ -134,10 +132,10 @@ public void TestPrecedence()
134
132
service . GetParameter ( "string" , typeof ( string ) , separator : null ) . Should ( ) . Be ( "commandLine" ) ;
135
133
136
134
service = new ParameterService ( ( ) => emptyArguments , ( ) => emptyEnvironmentVariables )
137
- {
138
- ArgumentsFromFilesService = parameterFileArguments ,
139
- ArgumentsFromCommitMessageService = commitMessageArguments
140
- } ;
135
+ {
136
+ ArgumentsFromFilesService = parameterFileArguments ,
137
+ ArgumentsFromCommitMessageService = commitMessageArguments
138
+ } ;
141
139
service . GetParameter ( "string" , typeof ( string ) , separator : null ) . Should ( ) . Be ( "commitMessage" ) ;
142
140
}
143
141
0 commit comments