diff options
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index 5181c748..6acf3472 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs | |||
@@ -56,5 +56,48 @@ namespace WixToolsetTest.CoreIntegration | |||
56 | Assert.Equal("Bar", example[1].AsString()); | 56 | Assert.Equal("Bar", example[1].AsString()); |
57 | } | 57 | } |
58 | } | 58 | } |
59 | |||
60 | [Fact] | ||
61 | public void CanParseCommandLineWithExtension() | ||
62 | { | ||
63 | var folder = TestData.Get(@"TestData\ExampleExtension"); | ||
64 | var extensionPath = Path.GetFullPath(new Uri(typeof(ExampleExtensionFactory).Assembly.CodeBase).LocalPath); | ||
65 | |||
66 | using (var fs = new DisposableFileSystem()) | ||
67 | { | ||
68 | var intermediateFolder = fs.GetFolder(); | ||
69 | |||
70 | var program = new Program(); | ||
71 | var result = program.Run(new WixToolsetServiceProvider(), new[] | ||
72 | { | ||
73 | "build", | ||
74 | Path.Combine(folder, "Package.wxs"), | ||
75 | Path.Combine(folder, "PackageComponents.wxs"), | ||
76 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
77 | "-ext", extensionPath, | ||
78 | "-bindpath", Path.Combine(folder, "data"), | ||
79 | "-intermediateFolder", intermediateFolder, | ||
80 | "-example", "test", | ||
81 | "-o", Path.Combine(intermediateFolder, @"bin\extest.msi") | ||
82 | }); | ||
83 | |||
84 | Assert.Equal(0, result); | ||
85 | |||
86 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\extest.msi"))); | ||
87 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\extest.wixpdb"))); | ||
88 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\MsiPackage\example.txt"))); | ||
89 | |||
90 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\extest.wir")); | ||
91 | var section = intermediate.Sections.Single(); | ||
92 | |||
93 | var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); | ||
94 | Assert.Equal(Path.Combine(folder, @"data\example.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
95 | Assert.Equal(@"example.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
96 | |||
97 | var property = section.Tuples.OfType<PropertyTuple>().Where(p => p.Id.Id == "ExampleProperty").Single(); | ||
98 | Assert.Equal("ExampleProperty", property.Property); | ||
99 | Assert.Equal("test", property.Value); | ||
100 | } | ||
101 | } | ||
59 | } | 102 | } |
60 | } | 103 | } |