| 1 | // 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. |
| 2 | |
| 3 | namespace WixToolsetTest.MsiE2E |
| 4 | { |
| 5 | using System; |
| 6 | using System.Collections.Generic; |
| 7 | using WixTestTools; |
| 8 | using Xunit; |
| 9 | using Xunit.Abstractions; |
| 10 | |
| 11 | [Collection("MsiE2E")] |
| 12 | public abstract class MsiE2ETests : WixTestBase, IDisposable |
| 13 | { |
| 14 | protected MsiE2ETests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | private Stack<IDisposable> Installers { get; } = new Stack<IDisposable>(); |
| 19 | |
| 20 | protected PackageInstaller CreatePackageInstaller(string filename) |
| 21 | { |
| 22 | var installer = new PackageInstaller(this.TestContext, filename); |
| 23 | this.Installers.Push(installer); |
| 24 | return installer; |
| 25 | } |
| 26 | |
| 27 | public void Dispose() |
| 28 | { |
| 29 | while (this.Installers.TryPop(out var installer)) |
| 30 | { |
| 31 | try |
| 32 | { |
| 33 | installer.Dispose(); |
| 34 | } |
| 35 | catch { } |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | [CollectionDefinition("MsiE2E", DisableParallelization = true)] |
| 41 | public class MsiE2ECollectionDefinition |
| 42 | { |
| 43 | } |
| 44 | } |