public void OrderShouldSetItselfAsParentForOrderDetail() { var order = new Order(); var detail = new OrderDetail(); order.AddOrderDetail(detail); Assert.AreSame(order, detail.Order); }
public void OrderShouldAddOrderDetail() { var order = new Order(); var detail = new OrderDetail(); order.AddOrderDetail(detail); Assert.AreSame(detail, order.OrderDetail); }
public virtual void AddOrderDetail(OrderDetail detail) { detail.Order = this; this.OrderDetail = detail; }
private Customer GetCustomer() { var customer = new Customer { ContactName = "johnny", Email = "*****@*****.**", Country = "Italy" }; var order1 = new Order { ShipName = "fjh rty", ShipAddress = "374 drgiaeroiu", ShipCity = "rtuket", ShipRegion = "reag qae", ShipPostalCode = "34573", ShipCountry = "tyjtwere" }; var order2 = new Order { ShipName = "ghdgh", ShipAddress = "fjsr4 4545 fghsf", ShipCity = "fyjshrk", ShipRegion = "tdguyket", ShipPostalCode = "9345672", ShipCountry = "ryjsytr" }; var detail = new OrderDetail { UnitPrice = 90.4m, Quantity = 28, Discount = 67.66m }; order1.AddOrderDetail(detail); customer.AddOrder(order1); customer.AddOrder(order2); return customer; }