Пример #1
0
        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);
            }
        }