@@ -155,14 +155,16 @@ public void UsernameAndPasswordCanBeParsed()
155155 public void UnknownOutputShouldThrow ( )
156156 {
157157 var exception = Assert . Throws < WarningException > ( ( ) => argumentParser . ParseArguments ( "targetDirectoryPath -output invalid_value" ) ) ;
158- exception . Message . ShouldBe ( "Value 'invalid_value' cannot be parsed as output type, please use 'json' or 'buildserver'" ) ;
158+ exception . Message . ShouldBe ( "Value 'invalid_value' cannot be parsed as output type, please use 'json', 'file' or 'buildserver'" ) ;
159159 }
160160
161161 [ Test ]
162162 public void OutputDefaultsToJson ( )
163163 {
164164 var arguments = argumentParser . ParseArguments ( "targetDirectoryPath" ) ;
165165 arguments . Output . ShouldContain ( OutputType . Json ) ;
166+ arguments . Output . ShouldNotContain ( OutputType . BuildServer ) ;
167+ arguments . Output . ShouldNotContain ( OutputType . File ) ;
166168 }
167169
168170 [ Test ]
@@ -171,6 +173,7 @@ public void OutputJsonCanBeParsed()
171173 var arguments = argumentParser . ParseArguments ( "targetDirectoryPath -output json" ) ;
172174 arguments . Output . ShouldContain ( OutputType . Json ) ;
173175 arguments . Output . ShouldNotContain ( OutputType . BuildServer ) ;
176+ arguments . Output . ShouldNotContain ( OutputType . File ) ;
174177 }
175178
176179 [ Test ]
@@ -179,6 +182,7 @@ public void MultipleOutputJsonCanBeParsed()
179182 var arguments = argumentParser . ParseArguments ( "targetDirectoryPath -output json -output json" ) ;
180183 arguments . Output . ShouldContain ( OutputType . Json ) ;
181184 arguments . Output . ShouldNotContain ( OutputType . BuildServer ) ;
185+ arguments . Output . ShouldNotContain ( OutputType . File ) ;
182186 }
183187
184188 [ Test ]
@@ -187,6 +191,7 @@ public void OutputBuildserverCanBeParsed()
187191 var arguments = argumentParser . ParseArguments ( "targetDirectoryPath -output buildserver" ) ;
188192 arguments . Output . ShouldContain ( OutputType . BuildServer ) ;
189193 arguments . Output . ShouldNotContain ( OutputType . Json ) ;
194+ arguments . Output . ShouldNotContain ( OutputType . File ) ;
190195 }
191196
192197 [ Test ]
@@ -195,6 +200,25 @@ public void MultipleOutputBuildserverCanBeParsed()
195200 var arguments = argumentParser . ParseArguments ( "targetDirectoryPath -output buildserver -output buildserver" ) ;
196201 arguments . Output . ShouldContain ( OutputType . BuildServer ) ;
197202 arguments . Output . ShouldNotContain ( OutputType . Json ) ;
203+ arguments . Output . ShouldNotContain ( OutputType . File ) ;
204+ }
205+
206+ [ Test ]
207+ public void OutputFileCanBeParsed ( )
208+ {
209+ var arguments = argumentParser . ParseArguments ( "targetDirectoryPath -output file" ) ;
210+ arguments . Output . ShouldContain ( OutputType . File ) ;
211+ arguments . Output . ShouldNotContain ( OutputType . BuildServer ) ;
212+ arguments . Output . ShouldNotContain ( OutputType . Json ) ;
213+ }
214+
215+ [ Test ]
216+ public void MultipleOutputFileCanBeParsed ( )
217+ {
218+ var arguments = argumentParser . ParseArguments ( "targetDirectoryPath -output file -output file" ) ;
219+ arguments . Output . ShouldContain ( OutputType . File ) ;
220+ arguments . Output . ShouldNotContain ( OutputType . BuildServer ) ;
221+ arguments . Output . ShouldNotContain ( OutputType . Json ) ;
198222 }
199223
200224 [ Test ]
@@ -203,6 +227,16 @@ public void OutputBuildserverAndJsonCanBeParsed()
203227 var arguments = argumentParser . ParseArguments ( "targetDirectoryPath -output buildserver -output json" ) ;
204228 arguments . Output . ShouldContain ( OutputType . BuildServer ) ;
205229 arguments . Output . ShouldContain ( OutputType . Json ) ;
230+ arguments . Output . ShouldNotContain ( OutputType . File ) ;
231+ }
232+
233+ [ Test ]
234+ public void OutputBuildserverAndJsonAndFileCanBeParsed ( )
235+ {
236+ var arguments = argumentParser . ParseArguments ( "targetDirectoryPath -output buildserver -output json -output file" ) ;
237+ arguments . Output . ShouldContain ( OutputType . BuildServer ) ;
238+ arguments . Output . ShouldContain ( OutputType . Json ) ;
239+ arguments . Output . ShouldContain ( OutputType . File ) ;
206240 }
207241
208242 [ Test ]
@@ -212,6 +246,16 @@ public void MultipleArgsAndFlag()
212246 arguments . Output . ShouldContain ( OutputType . BuildServer ) ;
213247 }
214248
249+ [ TestCase ( "-output file" , "GitVersion.json" ) ]
250+ [ TestCase ( "-output file -outputfile version.json" , "version.json" ) ]
251+ public void OutputFileArgumentCanBeParsed ( string args , string outputFile )
252+ {
253+ var arguments = argumentParser . ParseArguments ( args ) ;
254+
255+ arguments . Output . ShouldContain ( OutputType . File ) ;
256+ arguments . OutputFile . ShouldBe ( outputFile ) ;
257+ }
258+
215259 [ Test ]
216260 public void UrlAndBranchNameCanBeParsed ( )
217261 {
0 commit comments