tests
This commit is contained in:
@@ -31,7 +31,7 @@ namespace VisaApi.Fakers.Applicants
|
||||
=> new Passport
|
||||
{
|
||||
Issuer = f.Company.CompanyName(),
|
||||
Number = f.Random.String(ConfigurationConstraints.PasswordLength),
|
||||
Number = f.Random.String(ConfigurationConstraints.PasswordLength, 'a', 'z'),
|
||||
ExpirationDate = f.Date.Future(4, dateTimeProvider.Now()),
|
||||
IssueDate = f.Date.Past(4, dateTimeProvider.Now())
|
||||
});
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using ApplicationLayer.InfrastructureServicesInterfaces;
|
||||
using ApplicationLayer.Services.Applicants.Models;
|
||||
using Bogus;
|
||||
using Domains;
|
||||
|
||||
namespace VisaApi.Fakers.Applicants.Requests
|
||||
{
|
||||
public sealed class PassportModelFaker : Faker<PassportModel>
|
||||
{
|
||||
public PassportModelFaker(IDateTimeProvider dateTimeProvider)
|
||||
{
|
||||
RuleFor(m => m.Issuer, f => f.Company.CompanyName());
|
||||
|
||||
RuleFor(m => m.Number,
|
||||
f => f.Random.String(ConfigurationConstraints.PassportNumberLength, 'a', 'z'));
|
||||
|
||||
RuleFor(m => m.ExpirationDate,
|
||||
f => f.Date.Future(4, dateTimeProvider.Now()));
|
||||
|
||||
RuleFor(m => m.IssueDate,
|
||||
f => f.Date.Past(4, dateTimeProvider.Now()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using ApplicationLayer.Services.Applicants.Models;
|
||||
using Bogus;
|
||||
using Domains.ApplicantDomain;
|
||||
|
||||
namespace VisaApi.Fakers.Applicants.Requests
|
||||
{
|
||||
public sealed class PlaceOfWorkModelFaker : Faker<PlaceOfWorkModel>
|
||||
{
|
||||
public PlaceOfWorkModelFaker()
|
||||
{
|
||||
RuleFor(m => m.Name, f => f.Company.CompanyName());
|
||||
|
||||
RuleFor(m => m.PhoneNum, f => f.Phone.PhoneNumber("###########"));
|
||||
|
||||
RuleFor(m => m.Address,
|
||||
f => new AddressModel
|
||||
{
|
||||
Country = f.Address.Country(),
|
||||
City = f.Address.City(),
|
||||
Street = f.Address.StreetName(),
|
||||
Building = f.Address.BuildingNumber()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user