Пример #1
0
        public void TestRemoveSuccess()
        {
            var client = new SecretHub.Client();

            client.Write("secrethub/xgo/dotnet/test/delete-secret", "delete_secret_value");
            Assert.True(client.Exists("secrethub/xgo/dotnet/test/delete-secret"));
            client.Remove("secrethub/xgo/dotnet/test/delete-secret");
            Assert.False(client.Exists("secrethub/xgo/dotnet/test/delete-secret"));
        }
Пример #2
0
        public void TestExistsException()
        {
            var   client             = new SecretHub.Client();
            Regex expectedErrorRegex = new Regex(@"^.*\(api\.invalid_secret_path\) $");
            var   ex = Assert.Throws <ApplicationException>(() => client.Exists("not-a-path"));

            Assert.True(expectedErrorRegex.IsMatch(ex.Message), "error should end in the (api.invalid_secret_path) error code");
        }
Пример #3
0
        public void TestExists(string path, bool expectedTestResult)
        {
            var client = new SecretHub.Client();

            Assert.Equal(expectedTestResult, client.Exists(path));
        }