public static Faker <ApiResource> GetApiResourceFaker(int id)
        {
            var fakerApiResource = new Faker <ApiResource>()
                                   .RuleFor(o => o.Name, f => Guid.NewGuid().ToString())
                                   .RuleFor(o => o.Id, id)
                                   .RuleFor(o => o.Description, f => f.Random.Words(f.Random.Number(1, 5)))
                                   .RuleFor(o => o.DisplayName, f => f.Random.Words(f.Random.Number(1, 5)))
                                   .RuleFor(o => o.Enabled, f => f.Random.Bool())
                                   .RuleFor(o => o.RequireResourceIndicator, f => f.Random.Bool())
                                   .RuleFor(o => o.Scopes, new List <ApiResourceScope>())   //Api Scopes are managed with separate method
                                   .RuleFor(o => o.Secrets, new List <ApiResourceSecret>()) //Api Secret are managed with separate method
                                   .RuleFor(o => o.UserClaims, f => GetApiResourceClaimFaker(0).Generate(f.Random.Number(10)))
                                   .RuleFor(o => o.ShowInDiscoveryDocument, f => f.Random.Bool())
                                   .RuleFor(o => o.AllowedAccessTokenSigningAlgorithms, f => string.Join(",", ClientMock.AllowedSigningAlgorithms().Take(f.Random.Number(1, 5)).ToList()));

            return(fakerApiResource);
        }
        public static Faker <ClientDto> ClientFaker(int id)
        {
            var clientFaker = new Faker <ClientDto>()
                              .StrictMode(false)
                              .RuleFor(o => o.ClientId, f => Guid.NewGuid().ToString())
                              .RuleFor(o => o.ClientName, f => Guid.NewGuid().ToString())
                              .RuleFor(o => o.Id, id)
                              .RuleFor(o => o.AbsoluteRefreshTokenLifetime, f => f.Random.Number(int.MaxValue))
                              .RuleFor(o => o.AccessTokenLifetime, f => f.Random.Number(int.MaxValue))
                              .RuleFor(o => o.AccessTokenType, f => f.Random.Number(0, 1))
                              .RuleFor(o => o.AllowAccessTokensViaBrowser, f => f.Random.Bool())
                              .RuleFor(o => o.AllowOfflineAccess, f => f.Random.Bool())
                              .RuleFor(o => o.AllowPlainTextPkce, f => f.Random.Bool())
                              .RuleFor(o => o.AllowRememberConsent, f => f.Random.Bool())
                              .RuleFor(o => o.AllowedCorsOrigins, f => Enumerable.Range(1, f.Random.Int(1, 10)).Select(x => f.PickRandom(f.Internet.Url())).ToList())
                              .RuleFor(o => o.AllowedGrantTypes, f => Enumerable.Range(1, f.Random.Int(1, 10)).Select(x => f.PickRandom(ClientConsts.GetGrantTypes())).ToList())
                              .RuleFor(o => o.AllowedScopes, f => Enumerable.Range(1, f.Random.Int(1, 10)).Select(x => f.PickRandom(ClientMock.GetScopes())).ToList())
                              .RuleFor(o => o.AlwaysIncludeUserClaimsInIdToken, f => f.Random.Bool())
                              .RuleFor(o => o.Enabled, f => f.Random.Bool())
                              .RuleFor(o => o.ProtocolType, f => f.PickRandom(ClientConsts.GetProtocolTypes().Select(x => x.Id)))
                              .RuleFor(o => o.ClientSecrets, f => new List <ClientSecretDto>()) //Client Secrets are managed with seperate method
                              .RuleFor(o => o.RequireClientSecret, f => f.Random.Bool())
                              .RuleFor(o => o.Description, f => f.Random.Words(f.Random.Number(1, 7)))
                              .RuleFor(o => o.ClientUri, f => f.Internet.Url())
                              .RuleFor(o => o.RequireConsent, f => f.Random.Bool())
                              .RuleFor(o => o.RequirePkce, f => f.Random.Bool())
                              .RuleFor(o => o.RedirectUris, f => Enumerable.Range(1, f.Random.Int(1, 10)).Select(x => f.PickRandom(f.Internet.Url())).ToList())
                              .RuleFor(o => o.PostLogoutRedirectUris, f => Enumerable.Range(1, f.Random.Int(1, 10)).Select(x => f.PickRandom(f.Internet.Url())).ToList())
                              .RuleFor(o => o.FrontChannelLogoutUri, f => f.Internet.Url())
                              .RuleFor(o => o.FrontChannelLogoutSessionRequired, f => f.Random.Bool())
                              .RuleFor(o => o.BackChannelLogoutUri, f => f.Internet.Url())
                              .RuleFor(o => o.BackChannelLogoutSessionRequired, f => f.Random.Bool())
                              .RuleFor(o => o.IdentityTokenLifetime, f => f.Random.Number(int.MaxValue))
                              .RuleFor(o => o.AuthorizationCodeLifetime, f => f.Random.Number(int.MaxValue))
                              .RuleFor(o => o.ConsentLifetime, f => f.Random.Number(int.MaxValue))
                              .RuleFor(o => o.SlidingRefreshTokenLifetime, f => f.Random.Number(int.MaxValue))
                              .RuleFor(o => o.RefreshTokenUsage, f => f.Random.Number(0, 1))
                              .RuleFor(o => o.UpdateAccessTokenClaimsOnRefresh, f => f.Random.Bool())
                              .RuleFor(o => o.RefreshTokenExpiration, f => f.Random.Number(int.MaxValue))
                              .RuleFor(o => o.EnableLocalLogin, f => f.Random.Bool())
                              .RuleFor(o => o.AlwaysSendClientClaims, f => f.Random.Bool())
                              .RuleFor(o => o.ClientClaimsPrefix, f => Guid.NewGuid().ToString())
                              .RuleFor(o => o.IncludeJwtId, f => f.Random.Bool())
                              .RuleFor(o => o.PairWiseSubjectSalt, f => Guid.NewGuid().ToString())
                              .RuleFor(o => o.Claims, f => new List <ClientClaimDto>())        //Client Claims are managed with seperate method
                              .RuleFor(o => o.IdentityProviderRestrictions, f => Enumerable.Range(1, f.Random.Int(1, 10)).Select(x => f.PickRandom(ClientMock.GetIdentityProviders())).ToList())
                              .RuleFor(o => o.Properties, f => new List <ClientPropertyDto>()) //Client Properties are managed with seperate method
                              .RuleFor(o => o.LogoUri, f => f.Internet.Url())
                              .RuleFor(o => o.Updated, f => f.Date.Recent())
                              .RuleFor(o => o.LastAccessed, f => f.Date.Recent())
                              .RuleFor(o => o.UserSsoLifetime, f => f.Random.Int())
                              .RuleFor(o => o.UserCodeType, f => f.Random.Word())
                              .RuleFor(o => o.DeviceCodeLifetime, f => f.Random.Int())
                              .RuleFor(o => o.NonEditable, f => f.Random.Bool())
                              .RuleFor(o => o.RequireRequestObject, f => f.Random.Bool())
                              .RuleFor(o => o.AllowedIdentityTokenSigningAlgorithms, f => ClientMock.AllowedSigningAlgorithms().Take(f.Random.Number(1, 5)).ToList());

            return(clientFaker);
        }
        public static Faker <ApiResourceDto> GetApiResourceFaker(int id)
        {
            var fakerApiResource = new Faker <ApiResourceDto>()
                                   .RuleFor(o => o.Name, f => Guid.NewGuid().ToString())
                                   .RuleFor(o => o.Id, id)
                                   .RuleFor(o => o.Description, f => f.Random.Words(f.Random.Number(1, 5)))
                                   .RuleFor(o => o.DisplayName, f => f.Random.Words(f.Random.Number(1, 5)))
                                   .RuleFor(o => o.Enabled, f => f.Random.Bool())
                                   .RuleFor(o => o.RequireResourceIndicator, f => f.Random.Bool())
                                   .RuleFor(o => o.UserClaims, f => Enumerable.Range(1, f.Random.Int(1, 10)).Select(x => f.PickRandom(ClientConsts.GetStandardClaims())).ToList())
                                   .RuleFor(o => o.ShowInDiscoveryDocument, f => f.Random.Bool())
                                   .RuleFor(o => o.AllowedAccessTokenSigningAlgorithms, f => ClientMock.AllowedSigningAlgorithms().Take(f.Random.Number(1, 5)).ToList());

            return(fakerApiResource);
        }