public void TestReadStringSuccess() { var client = new SecretHub.Client(); string secret = client.ReadString("secrethub/xgo/dotnet/test/test-secret"); Assert.Equal("super_secret_value", secret); }
public void TestReadStringFail() { var client = new SecretHub.Client(); Regex expectedErrorRegex = new Regex(@"^.*\(server\.secret_not_found\) $"); var ex = Assert.Throws <ApplicationException>(() => client.ReadString("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 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"); }