Skip to content

Commit

Permalink
Only have extra assertions on the Event Buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel Nobel committed Jun 7, 2023
1 parent 0eb58ba commit 697aafd
Show file tree
Hide file tree
Showing 15 changed files with 408 additions and 456 deletions.
227 changes: 0 additions & 227 deletions src/Qowaiv.DomainModel.TestTools/AggregateRootAssert.cs

This file was deleted.

46 changes: 0 additions & 46 deletions src/Qowaiv.DomainModel.TestTools/Assert.cs

This file was deleted.

3 changes: 3 additions & 0 deletions src/Qowaiv.DomainModel.TestTools/AssertionFailed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class AssertionFailed : Exception
{
/// <summary>Initializes a new instance of the <see cref="AssertionFailed"/> class.</summary>
[ExcludeFromCodeCoverage/* Justification = "Required for inheritance only." */]
public AssertionFailed() : this("Assertion failed.") { }

/// <summary>Initializes a new instance of the <see cref="AssertionFailed"/> class.</summary>
Expand All @@ -24,6 +25,7 @@ public class AssertionFailed : Exception
/// The exception that is the cause of the current exception, or a null reference
/// if no inner exception is specified.
/// </param>
[ExcludeFromCodeCoverage/* Justification = "Required for inheritance only." */]
public AssertionFailed(string message, Exception innerException) : base(message, innerException) { }

/// <summary>Initializes a new instance of the <see cref="AssertionFailed"/> class.</summary>
Expand All @@ -33,5 +35,6 @@ public class AssertionFailed : Exception
/// <param name="context">
/// An object that describes the source or destination of the serialized data.
/// </param>
[ExcludeFromCodeCoverage/* Justification = "Required for inheritance only." */]
protected AssertionFailed(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Qowaiv.DomainModel;
using Qowaiv.DomainModel.TestTools.FluentAssertions;
using System.Diagnostics.Contracts;

namespace FluentAssertions;

/// <summary>Contains extension methods for custom assertions in unit tests.</summary>
[DebuggerNonUserCode]
public static class QowaivDomainModelFluentAssertions
{
/// <summary>
/// Returns an <see cref="EventBufferAssertions{TId}"/> object that can be used to assert the
/// current event buffer.
/// </summary>
/// <typeparam name="TId">
/// The type of the identifier of the event buffer.
/// </typeparam>
[Pure]
[CLSCompliant(false)]
public static EventBufferAssertions<TId> Should<TId>(this EventBuffer<TId> buffer) => new(buffer);
}
Loading

0 comments on commit 697aafd

Please sign in to comment.