Beispiel #1
0
        public void CustomerShouldSetItselfAsAParentForItsOrders()
        {
            var customer = new Customer();
            var order = new Order();

            customer.AddOrder(order);
            Assert.AreSame(customer, order.Customer);
        }
Beispiel #2
0
        public void CustomerShouldAddOrderToOrders()
        {
            var customer = new Customer();
            var order = new Order();

            customer.AddOrder(order);
            CollectionAssert.Contains(customer.Orders, order);
        }
Beispiel #3
0
        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;
        }