diff options
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs index 02422cf7..874151e4 100644 --- a/src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/BadInputFixture.cs | |||
@@ -6,11 +6,55 @@ namespace WixToolsetTest.CoreIntegration | |||
6 | using System.IO; | 6 | using System.IO; |
7 | using WixBuildTools.TestSupport; | 7 | using WixBuildTools.TestSupport; |
8 | using WixToolset.Core.TestPackage; | 8 | using WixToolset.Core.TestPackage; |
9 | using WixToolset.Data; | ||
9 | using Xunit; | 10 | using Xunit; |
10 | 11 | ||
11 | public class BadInputFixture | 12 | public class BadInputFixture |
12 | { | 13 | { |
13 | [Fact] | 14 | [Fact] |
15 | public void SwitchIsNotConsideredAnArgument() | ||
16 | { | ||
17 | var result = WixRunner.Execute(new[] | ||
18 | { | ||
19 | "build", | ||
20 | "-bindpath", "-thisisaswitchnotanarg", | ||
21 | }); | ||
22 | |||
23 | Assert.Single(result.Messages, m => m.Id == (int)ErrorMessages.Ids.ExpectedArgument); | ||
24 | // TODO: when CantBuildSingleExeBundleWithInvalidArgument is fixed, uncomment: | ||
25 | //Assert.Equal((int)ErrorMessages.Ids.ExpectedArgument, result.ExitCode); | ||
26 | } | ||
27 | |||
28 | [Fact(Skip = "Test demonstrates failure")] | ||
29 | public void CantBuildSingleExeBundleWithInvalidArgument() | ||
30 | { | ||
31 | var folder = TestData.Get(@"TestData"); | ||
32 | |||
33 | using (var fs = new DisposableFileSystem()) | ||
34 | { | ||
35 | var baseFolder = fs.GetFolder(); | ||
36 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
37 | var exePath = Path.Combine(baseFolder, @"bin\test.exe"); | ||
38 | |||
39 | var result = WixRunner.Execute(new[] | ||
40 | { | ||
41 | "build", | ||
42 | Path.Combine(folder, "SingleExeBundle", "SingleExePackageGroup.wxs"), | ||
43 | Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), | ||
44 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), | ||
45 | "-bindpath", Path.Combine(folder, ".Data"), | ||
46 | "-intermediateFolder", intermediateFolder, | ||
47 | "-o", exePath, | ||
48 | "-nonexistentswitch", "param", | ||
49 | }); | ||
50 | |||
51 | Assert.NotEqual(0, result.ExitCode); | ||
52 | |||
53 | Assert.False(File.Exists(exePath)); | ||
54 | } | ||
55 | } | ||
56 | |||
57 | [Fact] | ||
14 | public void RegistryKeyWithoutAttributesDoesntCrash() | 58 | public void RegistryKeyWithoutAttributesDoesntCrash() |
15 | { | 59 | { |
16 | var folder = TestData.Get(@"TestData\BadInput"); | 60 | var folder = TestData.Get(@"TestData\BadInput"); |