diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-05-26 17:33:15 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-05-31 13:20:44 -0500 |
| commit | fb4f8c7108f43d2341ba299424646c4963b21188 (patch) | |
| tree | 7f3c907ac5406d2000056f6bcca41d7ae4d3a925 /src/internal/WixBuildTools.TestSupport/XunitExtensions | |
| parent | 0f9931107ecf9e1f6714e6fd2cabc76d2ddb1153 (diff) | |
| download | wix-fb4f8c7108f43d2341ba299424646c4963b21188.tar.gz wix-fb4f8c7108f43d2341ba299424646c4963b21188.tar.bz2 wix-fb4f8c7108f43d2341ba299424646c4963b21188.zip | |
Replace PathIsAbsolute with PathIsRooted and add PathIsFullyQualified.
Diffstat (limited to 'src/internal/WixBuildTools.TestSupport/XunitExtensions')
| -rw-r--r-- | src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs | 19 | ||||
| -rw-r--r-- | src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs | 8 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs new file mode 100644 index 00000000..c66890f8 --- /dev/null +++ b/src/internal/WixBuildTools.TestSupport/XunitExtensions/SpecificReturnCodeException.cs | |||
| @@ -0,0 +1,19 @@ | |||
| 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 WixBuildTools.TestSupport | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using Xunit.Sdk; | ||
| 7 | |||
| 8 | public class SpecificReturnCodeException : XunitException | ||
| 9 | { | ||
| 10 | public SpecificReturnCodeException(int hr, string userMessage) | ||
| 11 | : base(String.Format("WixAssert.SpecificReturnCode() Failure\r\n" + | ||
| 12 | "HRESULT: 0x{0:X8}\r\n" + | ||
| 13 | "Message: {1}", | ||
| 14 | hr, userMessage)) | ||
| 15 | { | ||
| 16 | this.HResult = hr; | ||
| 17 | } | ||
| 18 | } | ||
| 19 | } | ||
diff --git a/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs b/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs index 10156547..1ede55b3 100644 --- a/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs +++ b/src/internal/WixBuildTools.TestSupport/XunitExtensions/WixAssert.cs | |||
| @@ -52,6 +52,14 @@ namespace WixBuildTools.TestSupport | |||
| 52 | throw new SkipTestException(message); | 52 | throw new SkipTestException(message); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | public static void SpecificReturnCode(int hrExpected, int hr, string format, params object[] formatArgs) | ||
| 56 | { | ||
| 57 | if (hrExpected != hr) | ||
| 58 | { | ||
| 59 | throw new SpecificReturnCodeException(hr, String.Format(format, formatArgs)); | ||
| 60 | } | ||
| 61 | } | ||
| 62 | |||
| 55 | public static void Succeeded(int hr, string format, params object[] formatArgs) | 63 | public static void Succeeded(int hr, string format, params object[] formatArgs) |
| 56 | { | 64 | { |
| 57 | if (0 > hr) | 65 | if (0 > hr) |
