Files
vegasco/tests/Vegasco.Server.Api.Tests.Integration/ConsumptionFaker.cs
ThompsonNye a1999bfe41
All checks were successful
continuous-integration/drone/push Build is passing
Rename WebApi project to Vegasco.Server.Api
And update all references including comments etc.
2025-06-12 18:23:09 +02:00

29 lines
736 B
C#

using Bogus;
using Vegasco.Server.Api.Consumptions;
namespace Vegasco.Server.Api.Tests.Integration;
internal class ConsumptionFaker
{
private readonly Faker _faker = new();
internal CreateConsumption.Request CreateConsumptionRequest(Guid carId)
{
return new CreateConsumption.Request(
_faker.Date.RecentOffset(),
_faker.Random.Int(1, 1_000),
_faker.Random.Int(20, 70),
_faker.Random.Bool(),
carId);
}
internal UpdateConsumption.Request UpdateConsumptionRequest()
{
CreateConsumption.Request createRequest = CreateConsumptionRequest(default);
return new UpdateConsumption.Request(
createRequest.DateTime,
createRequest.Distance,
createRequest.Amount,
createRequest.IgnoreInCalculation);
}
}