Skip to content

Instantly share code, notes, and snippets.

@plioi
Created January 26, 2016 22:59
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/0bb9b41a5b1005cbab70 to your computer and use it in GitHub Desktop.
Save plioi/0bb9b41a5b1005cbab70 to your computer and use it in GitHub Desktop.
public class ContactEditTests
{
...
public void ShouldSaveChangesToSelectedContact(Contact contactToEdit, Contact anotherContact)
{
Save(contactToEdit, anotherContact);
var selectedContactId = contactToEdit.Id;
Send(new ContactEdit.Command
{
Id = selectedContactId,
Name = "John Smith",
Email = "jsmith@example.com",
Phone = "555-123-0000"
});
var actual = Query(db => db.Contacts.Find(selectedContactId));
actual.Id.ShouldEqual(selectedContactId);
actual.Name.ShouldEqual("John Smith");
actual.Email.ShouldEqual("jsmith@example.com");
actual.Phone.ShouldEqual("555-123-0000");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment