Member-only story

Verify email content with C# Fluent Assertions

Alex Siminiuc
4 min readNov 17, 2019

--

Photo by Webaroo.com.au on Unsplash

Once in a while, the web test automation is about more than just interacting with a site.

Your test may need to verify that the site saves information properly in the cloud (Azure), or in a database.

Or it may need to verify that emails are being sent.

You get the email through the Exchange Web Services API and then save the email’s subject and body.

How do you validate that the email’s body has all the required information in it while still writing good code?

This is what I try exploring here.

Let’s say that your automated test verifies that an order can be placed in an ecommerce site and that an email is sent after the order placement is successful.

Before the order is placed, the site requires the user to fill in different pages lots of information such as

  • user address (street number and name, apartment or house number, city, postal code, province, country)
  • credit card information
  • delivery information
Photo by Charles 🇵🇭 on Unsplash

--

--

Alex Siminiuc
Alex Siminiuc

No responses yet