Amido.Testing.WebApi.ValidationRules.AssertBodyIncludesValueValidationRule.Validate C# (CSharp) Method

Validate() public method

The validate method.
public Validate ( object sender, ValidationEventArgs e ) : void
sender object The sender.
e ValidationEventArgs The
return void
        public override void Validate(object sender, ValidationEventArgs e)
        {
            if (e.Response.BodyString.IndexOf(expectedIncludedValue, System.StringComparison.Ordinal) > -1)
            {
                e.Message = "The body included the expected value.";
            }
            else
            {
                e.IsValid = false;
                e.Message = string.Format("The body did not include the expected value. Expected value: {0} Actual body: {1}", expectedIncludedValue, e.Response.BodyString);
            }
        }
    }
AssertBodyIncludesValueValidationRule