private void VerifyBodyPreview(DataStructures.Email email, DataStructures.Email allContentEmail, Request.BodyPreference[] bodyPreference)
{
Site.Assert.IsNotNull(
email.Body,
"The Body element should be included in command response when the BodyPreference element is specified in command request.");
Site.Assert.IsNotNull(
email.Body.Preview,
"The Preview element should be included in command response when the Preview element is specified in command request.");
Site.Assert.IsTrue(
email.Body.Preview.Length <= bodyPreference[0].Preview,
"The Preview element in a response should contain no more than the number of characters specified in the request. The length of Preview element in response is: {0}.",
email.Body.Preview.Length);
Site.Assert.IsTrue(
allContentEmail.Body.Data.Contains(email.Body.Preview),
"The Preview element in a response should contain the message part preview returned to the client.");
}