public void ChangesTest() { ProductCategory category = Changes.Create(); Changes.Update(category.ProductCategoryID, category.ProductSubcategories.Single().ProductSubcategoryID); Changes.SaveNoChanges(1); Changes.UpdateWithoutRead(category.ProductCategoryID); Changes.Delete(category.ProductSubcategories.Single().ProductSubcategoryID); Changes.DeleteWithoutRead(category.ProductCategoryID); try { Changes.DeleteWithRelationship(1); Assert.Fail(); } catch (DbUpdateException exception) { Trace.WriteLine(exception); } category = Changes.Create(); Changes.DeleteCascade(category.ProductCategoryID); try { Changes.UntrackedChanges(); Assert.Fail(); } catch (DbUpdateException exception) { Trace.WriteLine(exception); } }
public void ChangesTest() { ProductCategory category = Changes.Create(); Changes.Update(); Changes.SaveNoChanges(); Changes.UpdateWithoutRead(category.ProductCategoryID); Changes.Delete(); Changes.DeleteWithoutRead(category.ProductCategoryID); try { Changes.DeleteWithAssociation(); Assert.Fail(); } catch (DbUpdateException exception) { Trace.WriteLine(exception); } Changes.DeleteAllAssociated(); try { Changes.UntrackedChanges(); Assert.Fail(); } catch (InvalidOperationException exception) { Trace.WriteLine(exception); } }