using Bogus; namespace DigitalData.Core.Tests.Mock; public static class Fake { public static Faker CreateUserFaker(string? firstName = null, string? email = null, int? age = null) => new Faker() .RuleFor(u => u.FirstName, f => firstName ?? f.Name.FirstName()) .RuleFor(u => u.Email, f => email ?? f.Internet.Email()) .RuleFor(u => u.Age, f => age ?? f.Random.Int(18, 99)); private static readonly Faker UserFaker = CreateUserFaker(); public static User User => UserFaker.Generate(); public static List Users => UserFaker.Generate(Random.Shared.Next(1, 10)); public static Faker CreateUserCreateDtoFaker(string? firstName = null, string? email = null, int? age = null) => new Faker() .RuleFor(u => u.FirstName, f => firstName ?? f.Name.FirstName()) .RuleFor(u => u.Email, f => email ?? f.Internet.Email()) .RuleFor(u => u.Age, f => age ?? f.Random.Int(18, 99)); private static readonly Faker UserCreateDtoFaker = CreateUserCreateDtoFaker(); public static UserCreateDto UserCreateDto => UserCreateDtoFaker.Generate(); public static List UserCreateDtos => UserCreateDtoFaker.Generate(Random.Shared.Next(1, 10)); }