public void SaveOrUpdate_EntityExists_EntityIsUpdated() { using(var store = new Store(BuildConfiguration())) { OnStoreCreate(store); using(var steps = new Steps(store)) { var person = CreatePerson(1); // Arrange steps.BeginConversation(); steps.AddPeopleToStore(new Person[] { person }); // Act steps.SaveOrUpdatePerson(person); // Assert steps.VerifyPersonExists(person); } } }
public void SaveOrUpdate_EntityDoesntExists_EntityIsAddedAndIdIsAssigned() { using(var store = new Store(BuildConfiguration())) { OnStoreCreate(store); using(var steps = new Steps(store)) { var person = CreatePerson(1); // Arrange steps.BeginConversation(); // Act steps.SaveOrUpdatePerson(person); // Assert steps.VerifyIdIsAssigned(person); steps.VerifyPersonExists(person); } } }