Hey @amantinband !
First of all, thank you for this amazing template :+1:
I have a question on the EventualConsistencyMiddleware during integration testing.
Due to the transaction being commit after the request has return ok200, when testing for duplication how do you handle that ?
Do you add a delay in the test like below ? Or do you do something else ?
Thank you again !
Take care
public async Task Register_RegisterIdentity_WhenEmailIsAlreadyUsed()
{
// Arrange
var identity = _faker.Generate();
await _identityRequest.RegisterAsync(identity);
await Task.Delay(100); // Let the transaction being commited ?
// Act
var response = await _identityRequest.RegisterAsync(identity);
// Assert
response.IsSuccessStatusCode.Should().BeFalse();
response.StatusCode.Should().Be(HttpStatusCode.BadRequest);
var problem = await response.Error!.GetContentAsAsync<ProblemDetails>();
problem!.Detail.Should().Be(IdentityError.EmailAlreadyUsed(identity.Email).Description);
}
Hey @amantinband ! First of all, thank you for this amazing template :+1:
I have a question on the EventualConsistencyMiddleware during integration testing. Due to the transaction being commit after the request has return ok200, when testing for duplication how do you handle that ?
Do you add a delay in the test like below ? Or do you do something else ? Thank you again ! Take care