This commit is contained in:
2020-01-23 20:01:54 +00:00
parent d297927aaf
commit 65de42a4dc
2 changed files with 114 additions and 22 deletions

View File

@@ -411,15 +411,15 @@ namespace raven_integration
/// <param name="a"></param>
/// <param name="target"></param>
/// <param name="error"></param>
public static void ShouldContainValidationError(ApiResponse a, string target, string error, string message = null)
public static void ShouldContainValidationError(ApiResponse a, string target, string error, string shouldContainInMessage = null)
{
a.ObjectResponse["error"]["details"].Should().NotBeNull("There should be Details on the api call");
if (message != null)
if (shouldContainInMessage != null)
{
a.ObjectResponse["error"]["details"].Should().Contain(
m => m["target"].Value<string>() == target &&
m["error"].Value<string>() == error &&
m["message"].Value<string>() == message);
m["message"].Value<string>().Contains(shouldContainInMessage));
}
else
{