Skip to content

Instantly share code, notes, and snippets.

@plioi
Created January 26, 2016 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plioi/f0a1a59297de20b95557 to your computer and use it in GitHub Desktop.
Save plioi/f0a1a59297de20b95557 to your computer and use it in GitHub Desktop.
public class ContactEditTests
{
...
public void ShouldRequireMinimumFields()
{
new ContactEdit.Command()
.ShouldNotValidate("'Name' should not be empty.");
}
public void ShouldRequireValidEmailWhenProvided(ContactEdit.Command command)
{
command.Email = null;
command.ShouldValidate();
command.Email = "test@example.com";
command.ShouldValidate();
command.Email = "test at example dot com";
command.ShouldNotValidate("'Email' is not a valid email address.");
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment