forked from wixtoolset/wix
/
DifxAppExtensionFixture.cs
46 lines (39 loc) · 1.88 KB
/
DifxAppExtensionFixture.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
namespace WixToolsetTest.DifxApp
{
using System;
using System.IO;
using System.Linq;
using WixInternal.TestSupport;
using WixInternal.Core.TestPackage;
using WixToolset.DifxApp;
using Xunit;
public class DifxAppExtensionFixture
{
[Fact]
public void CanBuildUsingDriver()
{
var folder = TestData.Get(@"TestData\UsingDriver");
var build = new Builder(folder, typeof(DifxAppExtensionFactory), new[] { folder });
var results = build.BuildAndQuery(Build, "CustomAction");
WixAssert.CompareLineByLine(new[]
{
"CustomAction:MsiCleanupOnSuccess\t1\tDIFxAppx64\tCleanupOnSuccess\t",
"CustomAction:MsiInstallDrivers\t3073\tDIFxAppAx64\tInstallDriverPackages\t",
"CustomAction:MsiProcessDrivers\t1\tDIFxAppx64\tProcessDriverPackages\t",
"CustomAction:MsiRollbackInstall\t3329\tDIFxAppAx64\tRollbackInstall\t",
"CustomAction:MsiUninstallDrivers\t3073\tDIFxAppAx64\tUninstallDriverPackages\t",
}, results);
}
private static void Build(string[] args)
{
var newArgs = args.ToList();
newArgs.Add("-platform");
newArgs.Add("x64");
var extDir = Path.GetDirectoryName(new Uri(typeof(DifxAppExtensionFactory).Assembly.CodeBase).LocalPath);
newArgs.Add(Path.Combine(extDir, "..", "difxapp_x64.wixlib"));
var result = WixRunner.Execute(warningsAsErrors: false, newArgs.ToArray()).AssertSuccess();
Assert.Single(result.Messages.Where(m => m.Id == (int)WixToolset.Data.WarningMessages.Ids.DeprecatedElement));
}
}
}