aboutsummaryrefslogtreecommitdiff
path: root/src/ext/PowerShell/test/WixToolsetTest.PowerShell/PowerShellExtensionFixture.cs
blob: 31090bf6c446cece1a3b675ddaf17394622d1518 (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
28
29
30
// 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.

using Microsoft.VisualStudio.TestTools.UnitTesting;

[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]

namespace WixToolsetTest.PowerShell
{
    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);
        }
    }
}