aboutsummaryrefslogtreecommitdiff
path: root/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs')
-rw-r--r--src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
new file mode 100644
index 00000000..51122c28
--- /dev/null
+++ b/src/test/burn/WixToolsetTest.BurnE2E/RegistrationTests.cs
@@ -0,0 +1,78 @@
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
3namespace WixToolsetTest.BurnE2E
4{
5 using System;
6 using Xunit;
7 using Xunit.Abstractions;
8
9 public class RegistrationTests : BurnE2ETests
10 {
11 public RegistrationTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
12
13 [Fact]
14 public void AutomaticallyUncachesBundleWhenNotInstalled()
15 {
16 var bundleA = this.CreateBundleInstaller("BundleA");
17 var testBAController = this.CreateTestBAController();
18
19 var cachedBundlePath = bundleA.ManuallyCache();
20
21 testBAController.SetQuitAfterDetect();
22
23 bundleA.Install(cachedBundlePath);
24
25 bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
26 }
27
28 [Fact]
29 public void AutomaticallyUninstallsBundleWithoutBADoingApply()
30 {
31 this.InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(true);
32 }
33
34 [Fact]
35 public void AutomaticallyUninstallsBundleWithoutBADoingDetect()
36 {
37 this.InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(false);
38 }
39
40 [Fact]
41 public void RegistersInARPIfPrecached()
42 {
43 var bundleA = this.CreateBundleInstaller("BundleA");
44
45 bundleA.ManuallyCache();
46
47 // Verifies https://github.com/wixtoolset/issues/issues/5702
48 bundleA.Install();
49 bundleA.VerifyRegisteredAndInPackageCache();
50 }
51
52 private void InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(bool detect)
53 {
54 var packageA = this.CreatePackageInstaller("PackageA");
55 var bundleA = this.CreateBundleInstaller("BundleA");
56 var testBAController = this.CreateTestBAController();
57
58 bundleA.Install();
59 bundleA.VerifyRegisteredAndInPackageCache();
60 packageA.VerifyInstalled(true);
61
62 packageA.UninstallProduct();
63 bundleA.RemovePackageFromCache("PackageA");
64
65 if (detect)
66 {
67 testBAController.SetQuitAfterDetect();
68 }
69 else
70 {
71 testBAController.SetImmediatelyQuit();
72 }
73 bundleA.Install();
74 packageA.VerifyInstalled(false);
75 bundleA.VerifyUnregisteredAndRemovedFromPackageCache();
76 }
77 }
78}