-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathUnitTestExExpectations.Postgres.cs
More file actions
30 lines (28 loc) · 2.32 KB
/
Copy pathUnitTestExExpectations.Postgres.cs
File metadata and controls
30 lines (28 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma warning disable IDE0130 // Namespace does not match folder structure; by design.
namespace UnitTestEx.Expectations;
#pragma warning restore IDE0130 // Namespace does not match folder structure
/// <summary>
/// Provides <see cref="CoreEx"/>-specific extension methods to <see cref="UnitTestEx"/>.
/// </summary>
public static partial class UnitTestExExpectations
{
/// <summary>
/// Expects that no events will have been published for the keyed <see cref="IEventPublisher"/> (<paramref name="serviceKey"/> defaults to <see cref="PostgresOutboxPublisher.DefaultServiceKey"/>).
/// </summary>
/// <param name="tester">The <see cref="IExpectations{TSelf}"/> tester.</param>
/// <param name="serviceKey">The service key used for the keyed registration.</param>
/// <returns>The <typeparamref name="TSelf"/> instance to support fluent-style method-chaining.</returns>
/// <remarks>The <paramref name="serviceKey"/> must be the same as used when registering the underlying <see cref="IEventPublisher"/>.</remarks>
public static TSelf ExpectNoPostgresOutboxEvents<TSelf>(this IExpectations<TSelf> tester, string serviceKey = PostgresOutboxPublisher.DefaultServiceKey) where TSelf : IExpectations<TSelf>
=> ExpectNoEvents(tester, serviceKey);
/// <summary>
/// Expects that events will have been published for the keyed <see cref="IEventPublisher"/> (<paramref name="serviceKey"/> defaults to <see cref="PostgresOutboxPublisher.DefaultServiceKey"/>).
/// </summary>
/// <param name="tester">The <see cref="IExpectations{TSelf}"/> tester.</param>
/// <param name="configure">The action to enable events expectations configuration.</param>
/// <param name="serviceKey">The service key used for the keyed registration.</param>
/// <returns>The <typeparamref name="TSelf"/> instance to support fluent-style method-chaining.</returns>
/// <remarks>The <paramref name="serviceKey"/> must be the same as used when registering the underlying <see cref="IEventPublisher"/>.</remarks>
public static TSelf ExpectPostgresOutboxEvents<TSelf>(this IExpectations<TSelf> tester, Action<EventExpectationsConfig>? configure = null, string serviceKey = PostgresOutboxPublisher.DefaultServiceKey) where TSelf : IExpectations<TSelf>
=> ExpectEvents(tester, serviceKey, configure, Assembly.GetCallingAssembly());
}