Skip to content

Instantly share code, notes, and snippets.

@plioi
Created January 26, 2016 22:59
Show Gist options
  • Select an option

  • Save plioi/0bb9b41a5b1005cbab70 to your computer and use it in GitHub Desktop.

Select an option

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 = "[email protected]",
Phone = "555-123-0000"
});
var actual = Query(db => db.Contacts.Find(selectedContactId));
actual.Id.ShouldEqual(selectedContactId);
actual.Name.ShouldEqual("John Smith");
actual.Email.ShouldEqual("[email protected]");
actual.Phone.ShouldEqual("555-123-0000");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment