Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Test]
- public void shouldCorrectlyOrder()
- {
- {
- var product1 = new Product { Name = "Apples", UnitPrice = 4.5m, Discontinued = true };
- var product2 = new Product { Name = "Pears", UnitPrice = 3.5m, Discontinued = false };
- Session.Save(product1);
- Session.Save(product2);
- var orderItems = new List<OrderItem>
- {
- new OrderItem {Id = 1, Quantity = 100, Product = product1},
- new OrderItem {Id = 2, Quantity = 200, Product = product2},
- };
- var customer = new Customer
- {
- FirstName = "John",
- LastName = "Doe",
- AddressLine1 = "1st Street",
- PostalCode = "78279",
- City = "Austin",
- CountryCode = "US"
- };
- var employee = new Employee { FirstName = "Sue", LastName = "Wong" };
- new PersistenceSpecification<Order>(Session)
- .CheckProperty(o => o.OrderDate, DateTime.Today)
- .CheckReference(o => o.Customer, customer)
- .CheckReference(o => o.Employee, employee)
- .CheckList(o => o.OrderItems, orderItems)
- .VerifyTheMappings();
- }
- }
- [Test]
- public void shouldCorrectlyProduct()
- {
- new PersistenceSpecification<Product>(Session)
- .CheckProperty(p => p.Name, "Apples")
- .CheckProperty(p => p.UnitPrice, 10.45m)
- .CheckProperty(p => p.Discontinued, true)
- .VerifyTheMappings();
- }
Add Comment
Please, Sign In to add comment