File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 1
- using System . IO ;
1
+ using System ;
2
+ using System . IO ;
2
3
using NUnit . Framework ;
3
4
using Shouldly ;
4
5
@@ -30,4 +31,28 @@ public void RunExecViaCommandLine()
30
31
result . Log . ShouldContain ( "GitVersion_FullSemVer: 1.2.4+1" ) ;
31
32
}
32
33
}
34
+
35
+ [ Test ]
36
+ public void InvalidArgumentsExitCodeShouldNotBeZero ( )
37
+ {
38
+ using ( var fixture = new EmptyRepositoryFixture ( ) )
39
+ {
40
+ fixture . Repository . MakeATaggedCommit ( "1.2.3" ) ;
41
+ fixture . Repository . MakeACommit ( ) ;
42
+
43
+ var buildFile = Path . Combine ( fixture . RepositoryPath , "RunExecViaCommandLine.proj" ) ;
44
+ File . Delete ( buildFile ) ;
45
+ const string buildFileContent = @"<?xml version=""1.0"" encoding=""utf-8""?>
46
+ <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
47
+ <Target Name=""OutputResults"">
48
+ <Message Text=""GitVersion_FullSemVer: $(GitVersion_FullSemVer)""/>
49
+ </Target>
50
+ </Project>" ;
51
+ File . WriteAllText ( buildFile , buildFileContent ) ;
52
+ var result = GitVersionHelper . ExecuteIn ( fixture . RepositoryPath , arguments : " /invalid-argument" ) ;
53
+
54
+ result . ExitCode . ShouldBe ( 1 ) ;
55
+ result . Output . ShouldContain ( "Failed to parse arguments" ) ;
56
+ }
57
+ }
33
58
}
You can’t perform that action at this time.
0 commit comments