Вытащил солюшен на уровень выше, чтобы прощё было дотнетить
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is failing
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	continuous-integration/drone/push Build is failing
				
			This commit is contained in:
		| @@ -0,0 +1,28 @@ | ||||
| using ApplicationLayer.InfrastructureServicesInterfaces; | ||||
| using ApplicationLayer.Services.VisaApplications.Models; | ||||
| using Bogus; | ||||
|  | ||||
| namespace VisaApi.Fakers.VisaApplications.Requests; | ||||
|  | ||||
| /// <summary> | ||||
| /// Generates past visas | ||||
| /// </summary> | ||||
| public sealed class PastVisaModelFaker : Faker<PastVisaModel> | ||||
| { | ||||
|     private IDateTimeProvider dateTimeProvider; | ||||
|  | ||||
|     public PastVisaModelFaker(IDateTimeProvider dateTimeProvider) | ||||
|     { | ||||
|             this.dateTimeProvider = dateTimeProvider; | ||||
|  | ||||
|             RuleFor(pv => pv.Name, f => f.Random.Words()); | ||||
|         } | ||||
|  | ||||
|     public PastVisaModel GenerateValid() | ||||
|     { | ||||
|             var result = Generate(); | ||||
|             result.IssueDate = dateTimeProvider.Now().AddDays(-Random.Shared.Next(11, 900)); | ||||
|             result.ExpirationDate = result.IssueDate.AddDays(Random.Shared.Next(1, 11)); | ||||
|             return result; | ||||
|         } | ||||
| } | ||||
| @@ -0,0 +1,28 @@ | ||||
| using ApplicationLayer.InfrastructureServicesInterfaces; | ||||
| using ApplicationLayer.Services.VisaApplications.Models; | ||||
| using Bogus; | ||||
|  | ||||
| namespace VisaApi.Fakers.VisaApplications.Requests; | ||||
|  | ||||
| /// <summary> | ||||
| /// Generates past visas | ||||
| /// </summary> | ||||
| public sealed class PastVisitModelFaker : Faker<PastVisitModel> | ||||
| { | ||||
|     private IDateTimeProvider dateTimeProvider; | ||||
|  | ||||
|     public PastVisitModelFaker(IDateTimeProvider dateTimeProvider) | ||||
|     { | ||||
|             this.dateTimeProvider = dateTimeProvider; | ||||
|  | ||||
|             RuleFor(pv => pv.DestinationCountry, f => f.Address.Country()); | ||||
|         } | ||||
|  | ||||
|     public PastVisitModel GenerateValid() | ||||
|     { | ||||
|             var result = Generate(); | ||||
|             result.StartDate = dateTimeProvider.Now().AddDays(-Random.Shared.Next(11, 900)); | ||||
|             result.EndDate = result.StartDate.AddDays(Random.Shared.Next(1, 11)); | ||||
|             return result; | ||||
|         } | ||||
| } | ||||
| @@ -0,0 +1,17 @@ | ||||
| using ApplicationLayer.InfrastructureServicesInterfaces; | ||||
| using ApplicationLayer.Services.VisaApplications.Models; | ||||
| using Bogus; | ||||
|  | ||||
| namespace VisaApi.Fakers.VisaApplications.Requests | ||||
| { | ||||
|     public sealed class PermissionToDestCountryModelFaker : Faker<PermissionToDestCountryModel> | ||||
|     { | ||||
|         public PermissionToDestCountryModelFaker(IDateTimeProvider dateTimeProvider) | ||||
|         { | ||||
|             RuleFor(p => p.Issuer, f => f.Company.CompanyName()); | ||||
|  | ||||
|             RuleFor(p => p.ExpirationDate, | ||||
|                 f => f.Date.Future(4, dateTimeProvider.Now())); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,21 @@ | ||||
| using ApplicationLayer.InfrastructureServicesInterfaces; | ||||
| using ApplicationLayer.Services.VisaApplications.Models; | ||||
| using Bogus; | ||||
| using Domains; | ||||
|  | ||||
| namespace VisaApi.Fakers.VisaApplications.Requests; | ||||
|  | ||||
| /// <summary> | ||||
| /// Generates re-entry permissions | ||||
| /// </summary> | ||||
| public sealed class ReentryPermitModelFaker : Faker<ReentryPermitModel> | ||||
| { | ||||
|     public ReentryPermitModelFaker(IDateTimeProvider dateTimeProvider) | ||||
|     { | ||||
|             RuleFor(p => p.Number, | ||||
|                 f => f.Random.String(ConfigurationConstraints.ReentryPermitNumberLength, 'a', 'z')); | ||||
|  | ||||
|             RuleFor(p => p.ExpirationDate, | ||||
|                 f => f.Date.Future(4, dateTimeProvider.Now())); | ||||
|         } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user