summaryrefslogtreecommitdiff
path: root/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs
blob: b2f27ecf2d95d6fe7dc615a0772184c4e373e1bb (plain)
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
// 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.PowerShell
{
    using WixBuildTools.TestSupport;
    using WixToolset.Core.TestPackage;
    using WixToolset.PowerShell;
    using Xunit;

    public class PowerShellExtensionFixture
    {
        [Fact]
        public void CantBuildUsingTypesFileWithoutSnapIn()
        {
            var folder = TestData.Get(@"TestData\TypesFile");
            var build = new Builder(folder, typeof(PowerShellExtensionFactory), new[] { folder });

            WixRunnerResult wixRunnerResult = null;
            var results = build.BuildAndQuery(args => {
                wixRunnerResult = WixRunner.Execute(args);
            });
            Assert.NotNull(wixRunnerResult);
            Assert.Equal((int)PSErrors.Ids.NeitherIdSpecified, wixRunnerResult.ExitCode);
        }
    }
}