public void EntityIsNullAfterDelete() { EntityOps entityOps = new EntityOps(DbInit.DBInit().Context); Person newPerson = entityOps.CreateAndSavePerson(); Person deletedPerson = entityOps.DeleteAndGetPersonFromRelatedCollection(newPerson.Id, saveChanges: true); Assert.IsNull(deletedPerson); }
public void EntityIsNotNullAfterDeleteNotExpectedBehaviour() { EntityOps entityOps = new EntityOps(DbInit.DBInit().Context); Person newPerson = entityOps.CreateAndSavePerson(); Person deletedPerson = entityOps.DeleteAndGetPersonFromRelatedCollection(newPerson.Id); string error = @"Person received from collection of team is not null after delete. We need it null. SaveChanges helps but frequent execution of save make app slow"; Assert.IsNull(deletedPerson, error); }