Skip to content

Commit 77f81e5

Browse files
committed
feat: Add xunit v3 markers
1 parent bcc7469 commit 77f81e5

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

src/bunit.core/Asserting/ActualExpectedAssertException.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using Bunit.Internal.XUnitExceptions;
2+
13
namespace Bunit.Asserting;
24

35
/// <summary>
46
/// Represents a generic assert exception used when an actual result does not match an expected result.
57
/// </summary>
68
[Serializable]
7-
public class ActualExpectedAssertException : Exception
9+
public class ActualExpectedAssertException : Exception, IAssertionException
810
{
911
/// <summary>
1012
/// Initializes a new instance of the <see cref="ActualExpectedAssertException"/> class.

src/bunit.core/Extensions/WaitForHelpers/WaitForFailedException.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using Bunit.Internal.XUnitExceptions;
2+
13
namespace Bunit.Extensions.WaitForHelpers;
24

35
/// <summary>
46
/// Represents an exception thrown when the <see cref="WaitForHelper{T}"/> does not complete successfully.
57
/// </summary>
68
[Serializable]
7-
public sealed class WaitForFailedException : Exception
9+
public sealed class WaitForFailedException : Exception, ITestTimeoutException
810
{
911
/// <summary>
1012
/// Initializes a new instance of the <see cref="WaitForFailedException"/> class.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Bunit.Internal.XUnitExceptions;
2+
3+
/// <summary>
4+
/// This is a marker interface for xUnit.v3 that will cause xUnit to consider the failure cause to be an assertion failure.
5+
/// </summary>
6+
internal interface IAssertionException;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Bunit.Internal.XUnitExceptions;
2+
3+
/// <summary>
4+
/// This is a marker interface for xUnit.v3 that will cause xUnit to consider the failure cause to be a timeout.
5+
/// </summary>
6+
internal interface ITestTimeoutException;

src/bunit.core/ParameterException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace Bunit.RazorTesting;
22

33
/// <summary>
4-
/// Represents an missing or invalid Blazor parameter on a Blazor component.
4+
/// Represents a missing or invalid Blazor parameter on a Blazor component.
55
/// </summary>
66
[Serializable]
77
public sealed class ParameterException : ArgumentException

src/bunit.web/Extensions/ElementRemovedFromDomException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Bunit;
22

33
/// <summary>
44
/// Represents an exception that is thrown when trying to access an element
5-
/// that was previous found in the DOM.
5+
/// that was previously found in the DOM.
66
/// </summary>
77
[Serializable]
88
public sealed class ElementRemovedFromDomException : ElementNotFoundException

0 commit comments

Comments
 (0)