private string[] CreateArguments(string identityResourceName, string[] userClaims, params string[] args) { var mainArgs = new[] { CommandName, SubCommandName, identityResourceName }; var userClaimsArgs = CommandLineApplicationUtils.CreateMultipleOptionArguments("--user-claims", userClaims); return(mainArgs.Concat(userClaimsArgs) .Concat(args) .ToArray()); }
public void ShouldCreateANewClientWithAllowedCorsOrigins( string clientId, string[] allowedCorsOrigins ) { var allowedCorsOriginsArgs = CommandLineApplicationUtils.CreateMultipleOptionArguments("--allowed-cors-origins", allowedCorsOrigins) .ToArray(); var args = CreateArguments(clientId, allowedCorsOriginsArgs); this._commandLineApp.Execute(args); AddAsyncMustHaveHappenedWithApiResourceThat( c => c.ClientId == clientId && c.AllowedCorsOrigins.All(r => allowedCorsOriginsArgs.Contains(r))); SuccessMessageMustHaveHappened(); }
public void ShouldCreateANewClientWithPostLogoutRedirectUris( string clientId, string[] postLogoutRedirectUris ) { var postLogoutRedirectUrisArgs = CommandLineApplicationUtils.CreateMultipleOptionArguments( "--post-logout-redirect-uris", postLogoutRedirectUris) .ToArray(); var args = CreateArguments(clientId, postLogoutRedirectUrisArgs); this._commandLineApp.Execute(args); AddAsyncMustHaveHappenedWithApiResourceThat( c => c.ClientId == clientId && c.RedirectUris.All(r => postLogoutRedirectUrisArgs.Contains(r))); SuccessMessageMustHaveHappened(); }
public void ShouldCreateANewApiResourceWithTheInformedClaims(string apiResourceName, string[] claims) { var mainArgs = new string[] { CommandName, SubCommandName, apiResourceName }; var userClaimsArgs = CommandLineApplicationUtils.CreateMultipleOptionArguments("--user-claims", claims); var args = mainArgs.Concat(userClaimsArgs).ToArray(); this._commandLineApp.Execute(args); AddAsyncMustHaveHappenedWithApiResourceThat( a => a.Name == apiResourceName && a.UserClaims.All(c => claims.Contains(c))); SuccessMessageMustHaveHappened(); }
public void ShouldCreateANewApiResourceWithTheInformedScopes(string apiResourceName, string[] scopes) { var mainArgs = new string[] { CommandName, SubCommandName, apiResourceName }; var scopesArgs = CommandLineApplicationUtils.CreateMultipleOptionArguments("--scopes", scopes); var args = mainArgs.Concat(scopesArgs).ToArray(); this._commandLineApp.Execute(args); AddAsyncMustHaveHappenedWithApiResourceThat( a => a.Name == apiResourceName && a.Scopes.All(s => scopes.Contains(s.Name))); SuccessMessageMustHaveHappened(); }