Amido.Testing.WebApi.ValidationRules.AssertContentTypeEqualsValidationRule.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.ContentType == expectedContentType)
            {
                e.Message = "The content type was correct.";
            }
            else
            {
                e.IsValid = false;
                e.Message = string.Format("The content type was not correct. Expected: {0} Actual: {1}.", expectedContentType, e.Response.ContentType);
            }
        }
    }
AssertContentTypeEqualsValidationRule