Files
vegasco/tests/Vegasco.Server.Api.Tests.Integration/ConsumptionFaker.cs
ThompsonNye 5e084ab0a8
All checks were successful
continuous-integration/drone/push Build is passing
Fix recurring mock data
Reusing the faker instance like I used to seems to (suddenly?!)
result in the same data, which newly results in a conflict response
2025-06-24 20:01:45 +02:00

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);
}
}