Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add xunit v3 markers #1641

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/bunit.core/Asserting/ActualExpectedAssertException.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using Bunit.Internal.XUnitExceptions;

namespace Bunit.Asserting;

/// <summary>
/// Represents a generic assert exception used when an actual result does not match an expected result.
/// </summary>
[Serializable]
public class ActualExpectedAssertException : Exception
public class ActualExpectedAssertException : Exception, IAssertionException
{
/// <summary>
/// Initializes a new instance of the <see cref="ActualExpectedAssertException"/> class.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using Bunit.Internal.XUnitExceptions;

namespace Bunit.Extensions.WaitForHelpers;

/// <summary>
/// Represents an exception thrown when the <see cref="WaitForHelper{T}"/> does not complete successfully.
/// </summary>
[Serializable]
public sealed class WaitForFailedException : Exception
public sealed class WaitForFailedException : Exception, ITestTimeoutException
{
/// <summary>
/// Initializes a new instance of the <see cref="WaitForFailedException"/> class.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Bunit.Internal.XUnitExceptions;

/// <summary>
/// This is a marker interface for xUnit.v3 that will cause xUnit to consider the failure cause to be an assertion failure.
/// </summary>
internal interface IAssertionException;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Bunit.Internal.XUnitExceptions;

/// <summary>
/// This is a marker interface for xUnit.v3 that will cause xUnit to consider the failure cause to be a timeout.
/// </summary>
internal interface ITestTimeoutException;
2 changes: 1 addition & 1 deletion src/bunit.core/ParameterException.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Bunit.RazorTesting;

/// <summary>
/// Represents an missing or invalid Blazor parameter on a Blazor component.
/// Represents a missing or invalid Blazor parameter on a Blazor component.
/// </summary>
[Serializable]
public sealed class ParameterException : ArgumentException
Expand Down
2 changes: 1 addition & 1 deletion src/bunit.web/Extensions/ElementRemovedFromDomException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Bunit;

/// <summary>
/// Represents an exception that is thrown when trying to access an element
/// that was previous found in the DOM.
/// that was previously found in the DOM.
/// </summary>
[Serializable]
public sealed class ElementRemovedFromDomException : ElementNotFoundException
Expand Down
Loading