2024-08-23 18:02:18 +02:00
|
|
|
|
using Bogus;
|
2025-06-12 18:22:37 +02:00
|
|
|
|
using Vegasco.Server.Api.Consumptions;
|
2024-08-23 18:02:18 +02:00
|
|
|
|
|
2025-06-12 18:22:37 +02:00
|
|
|
|
namespace Vegasco.Server.Api.Tests.Integration;
|
2024-08-23 18:02:18 +02:00
|
|
|
|
|
|
|
|
|
|
internal class ConsumptionFaker
|
|
|
|
|
|
{
|
|
|
|
|
|
internal CreateConsumption.Request CreateConsumptionRequest(Guid carId)
|
|
|
|
|
|
{
|
2025-06-24 20:01:45 +02:00
|
|
|
|
Faker faker = new();
|
2024-08-23 18:02:18 +02:00
|
|
|
|
return new CreateConsumption.Request(
|
2025-06-24 20:01:45 +02:00
|
|
|
|
faker.Date.RecentOffset(),
|
|
|
|
|
|
faker.Random.Int(1, 1_000),
|
|
|
|
|
|
faker.Random.Int(20, 70),
|
2024-08-23 18:02:18 +02:00
|
|
|
|
carId);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal UpdateConsumption.Request UpdateConsumptionRequest()
|
|
|
|
|
|
{
|
2025-06-24 20:01:45 +02:00
|
|
|
|
CreateConsumption.Request createRequest = CreateConsumptionRequest(Guid.Empty);
|
2024-08-23 18:02:18 +02:00
|
|
|
|
return new UpdateConsumption.Request(
|
|
|
|
|
|
createRequest.DateTime,
|
|
|
|
|
|
createRequest.Distance,
|
2025-06-22 11:07:02 +02:00
|
|
|
|
createRequest.Amount);
|
2024-08-23 18:02:18 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|