Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad committed Oct 3, 2024
1 parent 632aff9 commit fb8e601
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Digdir.Tool.Dialogporten.GenerateFakeData/DialogGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public static List<CreateDialogDialogActivityDto> GenerateFakeDialogActivities(i
return new Faker<CreateDialogDialogActivityDto>()
.RuleFor(o => o.Id, () => Uuid7.NewUuid7().ToGuid(true))
.RuleFor(o => o.CreatedAt, f => f.Date.Past())
.RuleFor(o => o.ExtendedType, f => new Uri(f.Internet.UrlWithPath()))
.RuleFor(o => o.ExtendedType, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps)))
.RuleFor(o => o.Type, f => type ?? f.PickRandom(activityTypes))
.RuleFor(o => o.PerformedBy, f => new CreateDialogDialogActivityPerformedByActorDto { ActorType = ActorType.Values.PartyRepresentative, ActorName = f.Name.FullName() })
.RuleFor(o => o.Description, (f, o) => o.Type == DialogActivityType.Values.Information ? GenerateFakeLocalizations(f.Random.Number(4, 8)) : null)
Expand All @@ -280,19 +280,19 @@ public static List<CreateDialogDialogApiActionDto> GenerateFakeDialogApiActions(
public static List<CreateDialogDialogApiActionEndpointDto> GenerateFakeDialogApiActionEndpoints()
{
return new Faker<CreateDialogDialogApiActionEndpointDto>()
.RuleFor(o => o.Url, f => new Uri(f.Internet.UrlWithPath()))
.RuleFor(o => o.Url, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps)))
.RuleFor(o => o.HttpMethod, f => f.PickRandom<HttpVerb.Values>())
.RuleFor(o => o.Version, f => "v" + f.Random.Number(100, 999))
.RuleFor(o => o.Deprecated, f => f.Random.Bool())
.RuleFor(o => o.RequestSchema, f => new Uri(f.Internet.UrlWithPath()))
.RuleFor(o => o.ResponseSchema, f => new Uri(f.Internet.UrlWithPath()))
.RuleFor(o => o.DocumentationUrl, f => new Uri(f.Internet.UrlWithPath()))
.RuleFor(o => o.RequestSchema, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps)))
.RuleFor(o => o.ResponseSchema, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps)))
.RuleFor(o => o.DocumentationUrl, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps)))
.Generate(new Randomizer().Number(min: 1, 4));
}

public static string GenerateFakeProcessUri()
{
return new Faker().Internet.UrlWithPath();
return new Faker().Internet.UrlWithPath(Uri.UriSchemeHttps);
}

public static List<CreateDialogDialogGuiActionDto> GenerateFakeDialogGuiActions()
Expand All @@ -317,7 +317,7 @@ public static List<CreateDialogDialogGuiActionDto> GenerateFakeDialogGuiActions(
hasPrimary = true;
return DialogGuiActionPriority.Values.Primary;
})
.RuleFor(o => o.Url, f => new Uri(f.Internet.UrlWithPath()))
.RuleFor(o => o.Url, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps)))
.RuleFor(o => o.Title, f => GenerateFakeLocalizations(f.Random.Number(1, 3)))
.Generate(new Randomizer().Number(min: 1, 4));
}
Expand All @@ -336,7 +336,7 @@ public static List<CreateDialogDialogAttachmentDto> GenerateFakeDialogAttachment
public static List<CreateDialogDialogAttachmentUrlDto> GenerateFakeDialogAttachmentUrls()
{
return new Faker<CreateDialogDialogAttachmentUrlDto>()
.RuleFor(o => o.Url, f => new Uri(f.Internet.UrlWithPath()))
.RuleFor(o => o.Url, f => new Uri(f.Internet.UrlWithPath(Uri.UriSchemeHttps)))
.RuleFor(o => o.ConsumerType, f => f.PickRandom<AttachmentUrlConsumerType.Values>())
.Generate(new Randomizer().Number(1, 3));
}
Expand Down

0 comments on commit fb8e601

Please sign in to comment.