public void CannotRemoveAuthorizationServerManagementConsole() { // arrange var httpClient = new ClientsHttpClient(this.Authority, this.Handler); var clientId = "auth_console"; // act Func <Task> func = async() => await httpClient.RemoveClientAsync(clientId).ConfigureAwait(false); // assert func.Should().Throw <HttpException>().And.StatusCode.Should().Be(HttpStatusCode.BadRequest); }
public async Task CanRemoveClient() { // arrange var httpClient = new ClientsHttpClient(this.Authority, this.Handler); var client = new Client { Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture), Name = $"{nameof(ClientManagement)}.{nameof(this.CanRemoveClient)} (integration test)", }; await httpClient.AddClientAsync(client).ConfigureAwait(false); // act await httpClient.RemoveClientAsync(client.Id).ConfigureAwait(false); // assert var clientSummaries = await httpClient.GetClientSummariesAsync().ConfigureAwait(false); clientSummaries.Should().NotBeNull(); clientSummaries.Should().NotContain(summary => summary.Id == client.Id); }