Skip to content

Repository files navigation

Verify.MailMessage

DiscussionsBuild statusNuGet Status

Extends Verify to allow verification of MailMessage and related types.

See Milestones for release notes.

Sponsors

Entity Framework Extensions

Entity Framework Extensions is a major sponsor and is proud to contribute to the development this project.

Entity Framework Extensions

Developed using JetBrains IDEs

JetBrains logo.

NuGet

Usage

[ModuleInitializer]publicstaticvoidInitialize()=>VerifyMailMessage.Initialize();

snippet source | anchor

ContentDisposition

[Fact]publicTaskContentDisposition(){varcontent=newContentDisposition("attachment; filename=\"filename.jpg\"");returnVerify(content);}

snippet source | anchor

Results in:

{
DispositionType: attachment,
FileName: filename.jpg
}

snippet source | anchor

ContentType

[Fact]publicTaskContentType(){varcontent=newContentType("text/html; charset=utf-8"){Name="name.txt"};returnVerify(content);}

snippet source | anchor

Results in:

{
MediaType: text/html,
Name: name.txt,
CharSet: utf-8
}

snippet source | anchor

Attachment

[Fact]publicTaskAttachment(){varattachment=newAttachment(newMemoryStream("file content"u8.ToArray()),newContentType("text/html; charset=utf-8")){Name="name.txt"};returnVerify(attachment);}

snippet source | anchor

Results in:

{
Name: name.txt,
ContentType: {
MediaType: text/html,
Name: name.txt,
CharSet: utf-8
},
ContentId: Guid_1,
ContentDisposition: {
DispositionType: attachment
}
}

snippet source | anchor

MailMessage

[Fact]publicTaskMailMessage(){varmail=newMailMessage(from:"from@mail.com",to:"to@mail.com",subject:"The subject",body:"The body");returnVerify(mail);}

snippet source | anchor

Results in:

{
From: from@mail.com,
To: to@mail.com,
Subject: The subject,
IsBodyHtml: false,
Body: The body
}

snippet source | anchor

Icon

Mail from The Noun Project.

About

Extends Verify to allow verification of MailMessage and related types.

Resources

Code of conduct

Stars

1 star

Watchers

2 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages