示例#1
0
        public async Task Secrets()
        {
            var organization = await _organizationsApi.CreateOrganization(GenerateName("Constant Pro"));

            var secrets = await _organizationsApi.GetSecrets(organization);

            Assert.IsEmpty(secrets);

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

            await _organizationsApi.PutSecrets(secretsKv, organization);

            secrets = await _organizationsApi.GetSecrets(organization);

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

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

            secrets = await _organizationsApi.GetSecrets(organization);

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