public async Task TestRemoveApiKey() { using var client = new CdnClient(Constants.BaseUrl); await client.Login("admin", "password"); var tokenMaybe = await client.GetApiKey(); Assert.IsTrue(tokenMaybe.HasValue); Assert.IsNotEmpty(tokenMaybe.Value); await client.DeleteApiKey(); Assert.AreEqual(AuthenticationType.Jwt, client.CurrentAuthenticationType); }
public async Task GetApiKeyAndTestAuthentication() { using var client = new CdnClient(Constants.BaseUrl); await client.Login("admin", "password"); var tokenMaybe = await client.GetApiKey(); Assert.IsTrue(tokenMaybe.HasValue); Assert.IsNotEmpty(tokenMaybe.Value); (bool success, string message) = await client.TestAuthentication(); Assert.IsTrue(success); Assert.IsNotEmpty(message); }