From 02cdf55197d599d4d1fd611ad749d01f5c47a01f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 8 Jun 2020 16:26:59 -0700 Subject: Add "extension" command --- .../ExtensionFixture.cs | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/test') diff --git a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index ca7ce0c0..bad7f3ef 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs @@ -102,6 +102,48 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void CannotBuildWithMissingExtension() + { + var folder = TestData.Get(@"TestData\ExampleExtension"); + + using (var fs = new DisposableFileSystem()) + { + var intermediateFolder = fs.GetFolder(); + + var exception = Assert.Throws(() => + WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "Package.wxs"), + "-ext", "ExampleExtension.DoesNotExist" + })); + + Assert.StartsWith("The extension 'ExampleExtension.DoesNotExist' could not be found. Checked paths: ", exception.Message); + } + } + + [Fact] + public void CannotBuildWithMissingVersionedExtension() + { + var folder = TestData.Get(@"TestData\ExampleExtension"); + + using (var fs = new DisposableFileSystem()) + { + var intermediateFolder = fs.GetFolder(); + + var exception = Assert.Throws(() => + WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "Package.wxs"), + "-ext", "ExampleExtension.DoesNotExist/1.0.0" + })); + + Assert.StartsWith("The extension 'ExampleExtension.DoesNotExist/1.0.0' could not be found. Checked paths: ", exception.Message); + } + } + private static void Build(string[] args) { var result = WixRunner.Execute(args) -- cgit v1.2.3-55-g6feb