Skip to content

Commit

Permalink
console writes to debug tests on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
juuwel committed Apr 25, 2024
1 parent e470010 commit a53af0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Tests/AuthTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand All @@ -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;
});
}
Expand Down Expand Up @@ -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;
});
Expand Down
2 changes: 2 additions & 0 deletions Tests/PlantTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand All @@ -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;
});
}
Expand Down

0 comments on commit a53af0a

Please sign in to comment.