From a53af0aa6b7d008e90852826b40361234b4a1a00 Mon Sep 17 00:00:00 2001 From: Julia Ilasova <1julka1il@gmail.com> Date: Thu, 25 Apr 2024 10:45:30 +0200 Subject: [PATCH] console writes to debug tests on ci --- Tests/AuthTests.cs | 4 +++- Tests/PlantTests.cs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/AuthTests.cs b/Tests/AuthTests.cs index 88454dd..4bd15aa 100644 --- a/Tests/AuthTests.cs +++ b/Tests/AuthTests.cs @@ -17,6 +17,7 @@ public async Task RegisterLogInLogOut() var registerUserDto = GenerateRandomRegisterUserDto(); await ws.DoAndAssert(new ClientWantsToSignUpDto { RegisterUserDto = registerUserDto }, receivedMessages => { + receivedMessages.ForEach(e => Console.WriteLine(e.eventType)); return receivedMessages.Count(e => e.eventType == nameof(ServerSignsUserUp)) == 1; }); @@ -28,11 +29,13 @@ await ws.DoAndAssert(new ClientWantsToSignUpDto { RegisterUserDto = registerUser await ws.DoAndAssert(new ClientWantsToLogInDto { LoginDto = loginDto }, receivedMessages => { + receivedMessages.ForEach(e => Console.WriteLine(e.eventType)); return receivedMessages.Count(e => e.eventType == nameof(ServerAuthenticatesUser)) == 1; }); await ws.DoAndAssert(new ClientWantsToLogOutDto { UserEmail = registerUserDto.Email }, receivedMessages => { + receivedMessages.ForEach(e => Console.WriteLine(e.eventType)); return receivedMessages.Count(e => e.eventType == nameof(ServerLogsOutUser)) == 1; }); } @@ -107,7 +110,6 @@ public async Task LogInInvalidCredentials() await ws.DoAndAssert(new ClientWantsToLogInDto { LoginDto = loginDto }, receivedMessages => { - receivedMessages.ForEach(e => Console.WriteLine(e.eventType)); return receivedMessages.Count(e => e.eventType == nameof(ServerAuthenticatesUser)) == 0 && receivedMessages.Count(e => e.eventType == nameof(ServerRejectsWrongCredentials)) == 1; }); diff --git a/Tests/PlantTests.cs b/Tests/PlantTests.cs index 2d4feb7..6dc1ab1 100644 --- a/Tests/PlantTests.cs +++ b/Tests/PlantTests.cs @@ -21,6 +21,7 @@ public async Task CreatePlant() await webSocketTestClient.DoAndAssert(new ClientWantsToCreatePlantDto { CreatePlantDto = createPlantDto, Jwt = jwt }, receivedMessages => { + receivedMessages.ForEach(e => Console.WriteLine(e.eventType)); return receivedMessages.Count(e => e.eventType == nameof(ServerSendsPlant)) == 1; }); @@ -32,6 +33,7 @@ await webSocketTestClient.DoAndAssert(new ClientWantsAllPlantsDto PageSize = 10 }, receivedMessages => { + receivedMessages.ForEach(e => Console.WriteLine(e.eventType)); return receivedMessages.Count(e => e.eventType == nameof(ServerSendsAllPlants)) == 1; }); }