diff --git a/publisher/src/LeanCode.Pipe.TestClient/LeanPipeTestClient.cs b/publisher/src/LeanCode.Pipe.TestClient/LeanPipeTestClient.cs
index 9bd8dc9..f7f4d68 100644
--- a/publisher/src/LeanCode.Pipe.TestClient/LeanPipeTestClient.cs
+++ b/publisher/src/LeanCode.Pipe.TestClient/LeanPipeTestClient.cs
@@ -11,6 +11,9 @@
namespace LeanCode.Pipe.TestClient;
+///
+/// LeanPipe client designed to be used in the integration tests.
+///
public class LeanPipeTestClient : IAsyncDisposable
{
private readonly ConcurrentDictionary subscriptions =
@@ -23,6 +26,11 @@ public class LeanPipeTestClient : IAsyncDisposable
public IReadOnlyDictionary Subscriptions => subscriptions;
+ /// URL on which LeanPipe is exposed at.
+ /// Type catalog containing all topics and notifications.
+ /// Underneath hub connection config.
+ /// Serializer options used for deserializing notifications.
+ /// Time to wait for subscribe/unsubscribe response before considering failure.
public LeanPipeTestClient(
Uri leanPipeUrl,
TypesCatalog leanPipeTypes,
@@ -57,6 +65,7 @@ public LeanPipeTestClient(
);
}
+ /// Unsubscription result, if it doesn't time out.
public async Task UnsubscribeAsync(
TTopic topic,
CancellationToken ct = default
@@ -82,6 +91,8 @@ public LeanPipeTestClient(
return result;
}
+ /// Connects if there is no active connection.
+ /// Subscription result, if it doesn't time out.
public async Task SubscribeAsync(
TTopic topic,
CancellationToken ct = default
@@ -119,9 +130,7 @@ public LeanPipeTestClient(
public Task ConnectAsync(CancellationToken ct = default) => hubConnection.StartAsync(ct);
- ///
- /// Also clears all subscriptions.
- ///
+ /// Also clears all subscriptions.
public Task DisconnectAsync(CancellationToken ct = default)
{
foreach (var subscription in subscriptions.Values)
diff --git a/publisher/src/LeanCode.Pipe.TestClient/LeanPipeTestClientExtensions.cs b/publisher/src/LeanCode.Pipe.TestClient/LeanPipeTestClientExtensions.cs
index 33d954d..a2a7e5f 100644
--- a/publisher/src/LeanCode.Pipe.TestClient/LeanPipeTestClientExtensions.cs
+++ b/publisher/src/LeanCode.Pipe.TestClient/LeanPipeTestClientExtensions.cs
@@ -6,6 +6,12 @@ public static class LeanPipeTestClientExtensions
{
private static readonly TimeSpan DefaultNotificationAwaitTimeout = TimeSpan.FromSeconds(10);
+ ///
+ /// Subscribe to a topic instance or throw if it fails for any reason.
+ ///
+ /// Topic instance to subscribe to.
+ /// Subscription ID.
+ /// The subscription failed for any reason.
public static async Task SubscribeSuccessAsync(
this LeanPipeTestClient client,
TTopic topic,
@@ -30,6 +36,12 @@ public static async Task SubscribeSuccessAsync(
}
}
+ ///
+ /// Unsubscribe from a topic instance or throw if it fails for any reason.
+ ///
+ /// Topic instance to unsubscribe from.
+ /// Subscription ID.
+ /// The unsubscription failed for any reason.
public static async Task UnsubscribeSuccessAsync(
this LeanPipeTestClient client,
TTopic topic,
@@ -54,6 +66,17 @@ public static async Task UnsubscribeSuccessAsync(
}
}
+ ///
+ /// Returns a task, which completes when the next notification on the topic is received.
+ ///
+ ///
+ /// The task should be collected before the action which triggers notification publish
+ /// and awaited after the trigger.
+ /// Otherwise there is a possibility that the notification after the expected one is awaited.
+ /// Topic instance on which notification is to be awaited.
+ /// Timeout after which the notification is assumed to be not delivered.
+ /// Task containing received notification.
+ /// The topic instance received no notifications during the timeout.
public static async Task