Fix recurring mock data
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reusing the faker instance like I used to seems to (suddenly?!) result in the same data, which newly results in a conflict response
This commit is contained in:
@@ -5,20 +5,19 @@ namespace Vegasco.Server.Api.Tests.Integration;
|
||||
|
||||
internal class ConsumptionFaker
|
||||
{
|
||||
private readonly Faker _faker = new();
|
||||
|
||||
internal CreateConsumption.Request CreateConsumptionRequest(Guid carId)
|
||||
{
|
||||
Faker faker = new();
|
||||
return new CreateConsumption.Request(
|
||||
_faker.Date.RecentOffset(),
|
||||
_faker.Random.Int(1, 1_000),
|
||||
_faker.Random.Int(20, 70),
|
||||
faker.Date.RecentOffset(),
|
||||
faker.Random.Int(1, 1_000),
|
||||
faker.Random.Int(20, 70),
|
||||
carId);
|
||||
}
|
||||
|
||||
internal UpdateConsumption.Request UpdateConsumptionRequest()
|
||||
{
|
||||
CreateConsumption.Request createRequest = CreateConsumptionRequest(default);
|
||||
CreateConsumption.Request createRequest = CreateConsumptionRequest(Guid.Empty);
|
||||
return new UpdateConsumption.Request(
|
||||
createRequest.DateTime,
|
||||
createRequest.Distance,
|
||||
|
||||
Reference in New Issue
Block a user