Extends Verify to allow verification of MailMessage and related types.
See Milestones for release notes.
Entity Framework Extensions is a major sponsor and is proud to contribute to the development this project.
[ModuleInitializer]publicstaticvoidInitialize()=>VerifyMailMessage.Initialize();[Fact]publicTaskContentDisposition(){varcontent=newContentDisposition("attachment; filename=\"filename.jpg\"");returnVerify(content);}Results in:
{
DispositionType: attachment,
FileName: filename.jpg
}[Fact]publicTaskContentType(){varcontent=newContentType("text/html; charset=utf-8"){Name="name.txt"};returnVerify(content);}Results in:
{
MediaType: text/html,
Name: name.txt,
CharSet: utf-8
}[Fact]publicTaskAttachment(){varattachment=newAttachment(newMemoryStream("file content"u8.ToArray()),newContentType("text/html; charset=utf-8")){Name="name.txt"};returnVerify(attachment);}Results in:
{
Name: name.txt,
ContentType: {
MediaType: text/html,
Name: name.txt,
CharSet: utf-8
},
ContentId: Guid_1,
ContentDisposition: {
DispositionType: attachment
}
}[Fact]publicTaskMailMessage(){varmail=newMailMessage(from:"from@mail.com",to:"to@mail.com",subject:"The subject",body:"The body");returnVerify(mail);}Results in:
{
From: from@mail.com,
To: to@mail.com,
Subject: The subject,
IsBodyHtml: false,
Body: The body
}Mail from The Noun Project.

