Skip to content

Commit

Permalink
listen for more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
juuwel committed May 28, 2024
1 parent 6b95429 commit 4fbad2d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Tests/WebSocketTestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ public WebSocketTestClient(string? url = null)
{
BaseDto baseDto = JsonSerializer.Deserialize<BaseDto>(msg.Text);

if (baseDto.eventType == "ServerSendsError")
if (baseDto.eventType == "ServerSendsErrorMessage" || baseDto.eventType.Contains("ServerResponds") || baseDto.eventType.Contains("ServerRejects"))
{
var error = JsonSerializer.Deserialize<ServerSendsErrorMessage>(msg.Text);
throw new Exception(error!.Error);
}


lock (ReceivedMessages)
ReceivedMessages.Add(baseDto);
});
Expand All @@ -49,7 +48,7 @@ public async Task DoAndAssert<T>(T? action = null, Func<List<BaseDto>, bool>? co
if (condition != null)
{
DateTime startTime = DateTime.UtcNow;
while (DateTime.UtcNow - startTime < TimeSpan.FromSeconds(10.0))
while (DateTime.UtcNow - startTime < TimeSpan.FromSeconds(5.0))
{
lock (ReceivedMessages)
{
Expand Down

0 comments on commit 4fbad2d

Please sign in to comment.