private void AssertMultipleEmailErrors(ApiApplicationError error1, ApiApplicationError error2) { if (error1.message.Contains("maximum length")) { AssertApplicationError(error1, "email-too-long", "The field Email must be a string with a maximum length of 100.", null); AssertApplicationError(error2, "email-invalid", "The Email field is not a valid e-mail address.", null); } else { AssertApplicationError(error1, "email-invalid", "The Email field is not a valid e-mail address.", null); AssertApplicationError(error2, "email-too-long", "The field Email must be a string with a maximum length of 100.", null); } }
protected void AssertApplicationErrorDataContainsFragment(ApiApplicationError error, string code, string message, string dataFragment) { Assert.That(error.code, Is.EqualTo(code)); Assert.That(error.message, Is.EqualTo(message)); Assert.That(error.data, Is.StringContaining(dataFragment)); }
protected void AssertApplicationError(ApiApplicationError error, string code, string message, string data = null) { Assert.That(error.code, Is.EqualTo(code)); Assert.That(error.message, Is.EqualTo(message)); Assert.That(error.data, Is.EqualTo(data)); }