aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-07-12 10:31:24 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-07-12 11:45:45 +1000
commit1d77b037520a804a1d8f586faad86619b291a1a9 (patch)
tree22b7bdd3c2b218decee0b34af07e782c9d9317b6 /src
parent918a7ca291a9811dd2ff01508e2710b54c86f9eb (diff)
downloadwix-1d77b037520a804a1d8f586faad86619b291a1a9.tar.gz
wix-1d77b037520a804a1d8f586faad86619b291a1a9.tar.bz2
wix-1d77b037520a804a1d8f586faad86619b291a1a9.zip
Add WixAssert and SucceededException.
Diffstat (limited to 'src')
-rw-r--r--src/WixBuildTools.TestSupport/SucceededException.cs18
-rw-r--r--src/WixBuildTools.TestSupport/WixAssert.cs18
2 files changed, 36 insertions, 0 deletions
diff --git a/src/WixBuildTools.TestSupport/SucceededException.cs b/src/WixBuildTools.TestSupport/SucceededException.cs
new file mode 100644
index 00000000..00b31d68
--- /dev/null
+++ b/src/WixBuildTools.TestSupport/SucceededException.cs
@@ -0,0 +1,18 @@
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 WixBuildTools.TestSupport
4{
5 using System;
6 using Xunit.Sdk;
7
8 public class SucceededException : XunitException
9 {
10 public SucceededException(int hr, string userMessage)
11 : base(String.Format("WixAssert.Succeeded() Failure\r\n" +
12 "HRESULT: 0x{0:X8}\r\n" +
13 "Message: {1}",
14 hr, userMessage))
15 {
16 }
17 }
18}
diff --git a/src/WixBuildTools.TestSupport/WixAssert.cs b/src/WixBuildTools.TestSupport/WixAssert.cs
new file mode 100644
index 00000000..4a5c6a97
--- /dev/null
+++ b/src/WixBuildTools.TestSupport/WixAssert.cs
@@ -0,0 +1,18 @@
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 WixBuildTools.TestSupport
4{
5 using System;
6 using Xunit;
7
8 public class WixAssert : Assert
9 {
10 public static void Succeeded(int hr, string format, params object[] formatArgs)
11 {
12 if (0 > hr)
13 {
14 throw new SucceededException(hr, String.Format(format, formatArgs));
15 }
16 }
17 }
18}