public void SynchronizingUpdatedCustomer() { // Get an existing customer from MSSQL and change it Customer cust; using (var repo = new EF.Repository()) { cust = repo.All <Customer>().Single(c => c.Email == "*****@*****.**"); cust.City = "Ololo"; repo.Update(cust); repo.Save(); } // Run the workflow WorkflowInvoker.Invoke(new Main()); // Get same customer from Oracle and compare Customer cust2; using (var repo = new NH.Repository()) { cust2 = repo.All <Customer>().Single(c => c.Email == "*****@*****.**"); } Assert.AreEqual(cust.City, cust2.City); }
public void SynchronizingUpdatedCustomerWithConflict() { // Get an existing customer from MSSQL and change it using (var repo = new EF.Repository()) { Customer cust = repo.All <Customer>().Single(c => c.Email == "*****@*****.**"); cust.City = "Bubu"; repo.Update(cust); repo.Save(); } // Give it some time Thread.Sleep(1000); // Get same customer from Oracle and introduce a conflicting change Customer cust2; using (var repo = new NH.Repository()) { cust2 = repo.All <Customer>().Single(c => c.Email == "*****@*****.**"); cust2.City = "Koko"; repo.Update(cust2); repo.Save(); } // Run the workflow WorkflowInvoker.Invoke(new Main()); // Get the customer from MSSQL and compare Customer cust3; using (var repo = new EF.Repository()) { cust3 = repo.All <Customer>().Single(c => c.Email == "*****@*****.**"); } Assert.AreEqual(cust2.City, cust3.City); }