public void TestTeardown()
 {
     Context = new PocoContext(ConnectionString);
     Context.ExecuteStoreCommand("DELETE OrderItems");
     Context.ExecuteStoreCommand("DELETE Products");
     Context.ExecuteStoreCommand("DELETE Orders");
     Context.ExecuteStoreCommand("DELETE Customers");
 }
Exemplo n.º 2
0
 public void TestTeardown()
 {
     Context = new PocoContext(ConnectionString);
     Context.ExecuteStoreCommand("DELETE OrderItems");
     Context.ExecuteStoreCommand("DELETE Products");
     Context.ExecuteStoreCommand("DELETE Orders");
     Context.ExecuteStoreCommand("DELETE Customers");
 }
Exemplo n.º 3
0
        public void Can_attach_modified_entity()
        {
            Customer customer = null;
            var testData = new EFTestData(Context);
            testData.Batch(x => customer = x.CreateCustomer());
            Context.Detach(customer);
            Context.Dispose();

            using (var scope = new UnitOfWorkScope())
            {
                customer.LastName = "Changed";
                var repository = new EFRepository<Customer>();
                repository.Attach(customer);
                scope.Commit();
            }

            Context = new PocoContext(ConnectionString);
            testData = new EFTestData(Context);
            customer = testData.Get<Customer>(x => x.CustomerID == customer.CustomerID);
            Assert.That(customer.LastName, Is.EqualTo("Changed"));
        }
Exemplo n.º 4
0
        public void Can_attach_modified_entity()
        {
            Customer customer = null;
            var      testData = new EFTestData(Context);

            testData.Batch(x => customer = x.CreateCustomer());
            Context.Detach(customer);
            Context.Dispose();

            using (var scope = new UnitOfWorkScope())
            {
                customer.LastName = "Changed";
                var repository = new EFRepository <Customer>();
                repository.Attach(customer);
                scope.Commit();
            }

            Context  = new PocoContext(ConnectionString);
            testData = new EFTestData(Context);
            customer = testData.Get <Customer>(x => x.CustomerID == customer.CustomerID);
            Assert.That(customer.LastName, Is.EqualTo("Changed"));
        }
 public virtual void TestSetup()
 {
     State = new FakeState();
     Context = new PocoContext(ConnectionString);
 }
Exemplo n.º 6
0
 public virtual void TestSetup()
 {
     State   = new FakeState();
     Context = new PocoContext(ConnectionString);
 }