Esempio n. 1
0
        public async Task Secrets()
        {
            var organization = await _organizationsApi.CreateOrganizationAsync(GenerateName("Constant Pro"));

            var secrets = await _organizationsApi.GetSecretsAsync(organization);

            Assert.That(secrets, Is.Null.Or.Empty);

            var secretsKv = new Dictionary <string, string> {
                { "gh", "123456789" }, { "az", "987654321" }
            };

            await _organizationsApi.PutSecretsAsync(secretsKv, organization);

            secrets = await _organizationsApi.GetSecretsAsync(organization);

            Assert.AreEqual(2, secrets.Count);
            Assert.Contains("gh", secrets);
            Assert.Contains("az", secrets);

            await _organizationsApi.DeleteSecretsAsync(new List <string> {
                "gh"
            }, organization);

            secrets = await _organizationsApi.GetSecretsAsync(organization);

            Assert.AreEqual(1, secrets.Count);
            Assert.Contains("az", secrets);
        }