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
26 lines
655 B
C#
26 lines
655 B
C#
using Bogus;
|
|
using Vegasco.Server.Api.Consumptions;
|
|
|
|
namespace Vegasco.Server.Api.Tests.Integration;
|
|
|
|
internal class ConsumptionFaker
|
|
{
|
|
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),
|
|
carId);
|
|
}
|
|
|
|
internal UpdateConsumption.Request UpdateConsumptionRequest()
|
|
{
|
|
CreateConsumption.Request createRequest = CreateConsumptionRequest(Guid.Empty);
|
|
return new UpdateConsumption.Request(
|
|
createRequest.DateTime,
|
|
createRequest.Distance,
|
|
createRequest.Amount);
|
|
}
|
|
} |