public void Can_save()
 {
     int customerId;
     using (var scope = new UnitOfWorkScope())
     {
         var customer = new Customer
         {
             FirstName = "Jane",
             LastName = "Doe",
             StreetAddress1 = "123 Main St.",
         };
         new EFRepository<Customer>().Add(customer);
         scope.Commit();
         customerId = customer.CustomerID;
     }
     var savedCustomer = new EFTestData(Context)
         .Get<Customer>(x => x.CustomerID == customerId);
     Assert.That(savedCustomer, Is.Not.Null);
 }
Esempio n. 2
0
 public Order CreateOrderForCustomer(Customer customer)
 {
     var order = CreateOrder(x => x.Customer = customer);
     customer.Orders.Add(order);
     return order;
 }