diff options
author | crupest <crupest@outlook.com> | 2021-06-02 12:44:42 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-02 12:44:42 +0800 |
commit | 02502642313118b9bf44db01ecb6620232964353 (patch) | |
tree | b5f968788da237c3689dd7b2a5c275d508797bb0 | |
parent | 97824588a3e015671bf15408d2b1129567c0f12d (diff) | |
download | timeline-02502642313118b9bf44db01ecb6620232964353.tar.gz timeline-02502642313118b9bf44db01ecb6620232964353.tar.bz2 timeline-02502642313118b9bf44db01ecb6620232964353.zip |
test: Use ws protocol to test signalr hub.
-rw-r--r-- | BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs index e8b774d8..0c4225c6 100644 --- a/BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs +++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelineHubTest.cs @@ -17,7 +17,7 @@ namespace Timeline.Tests.IntegratedTests private HubConnection CreateConnection(string? token)
{
- return new HubConnectionBuilder().WithUrl("http://localhost/api/hub/timeline",
+ return new HubConnectionBuilder().WithUrl("ws://localhost/api/hub/timeline",
options =>
{
options.HttpMessageHandlerFactory = _ => TestApp.Server.CreateHandler();
@@ -47,13 +47,11 @@ namespace Timeline.Tests.IntegratedTests using var client = await CreateClientAsUser();
await client.TestPostAsync($"timelines/{generator(1)}/posts", TimelinePostTest.CreateTextPostRequest("aaa"));
- await Task.Delay(1);
changed.Should().BeFalse();
await connection.InvokeAsync(nameof(TimelineHub.SubscribeTimelinePostChange), generator(1));
await client.TestPostAsync($"timelines/{generator(1)}/posts", TimelinePostTest.CreateTextPostRequest("bbb"));
- await Task.Delay(1);
changed.Should().BeTrue();
changed = false;
@@ -61,7 +59,6 @@ namespace Timeline.Tests.IntegratedTests await connection.InvokeAsync(nameof(TimelineHub.UnsubscribeTimelinePostChange), generator(1));
await client.TestPostAsync($"timelines/{generator(1)}/posts", TimelinePostTest.CreateTextPostRequest("ccc"));
- await Task.Delay(1);
changed.Should().BeFalse();
}
|