summaryrefslogtreecommitdiff
path: root/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs
blob: a1dc3282793f40d4afdb4e155da8feb6dbeb783f (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
27
// 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 Microsoft.VisualStudio.TestTools.UnitTesting;
    using WixInternal.MSTestSupport;
    using WixInternal.Core.MSTestPackage;
    using WixToolset.PowerShell;

    [TestClass]
    public class PowerShellExtensionFixture
    {
        [TestMethod]
        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.IsNotNull(wixRunnerResult);
            Assert.AreEqual((int)PSErrors.Ids.NeitherIdSpecified, wixRunnerResult.ExitCode);
        }
    }
}