public void TestRemoveFail() { var client = new SecretHub.Client(); Regex expectedErrorRegex = new Regex(@"^.*\(server\.secret_not_found\) $"); var ex = Assert.Throws <ApplicationException>(() => client.Remove("secrethub/xgo/dotnet/test/not-this-one")); Assert.True(expectedErrorRegex.IsMatch(ex.Message), "error should end in the (server.secret_not_found) error code"); }
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")); }
public void TestWriteSuccess() { var client = new SecretHub.Client(); client.Write("secrethub/xgo/dotnet/test/new-secret", "new_secret_value"); String secret = client.ReadString("secrethub/xgo/dotnet/test/new-secret"); Assert.Equal("new_secret_value", secret); client.Remove("secrethub/xgo/dotnet/test/new-secret"); }