//could create an OrderDisplayRepository
        public OrderDisplay RetrieveOrderDisplay(int orderId)
        {
            var orderDisplay = new OrderDisplay();

            orderDisplay.orderDisplayItemList = new List <OrderDisplayItem>();
            return(orderDisplay);
        }
        public OrderDisplay RetrieveOrderDisplay(int orderId)
        {
            OrderDisplay orderDisplay = new OrderDisplay();

            var addressRepository = new AddressRepository();

            if (orderId == 10)
            {
                orderDisplay.FirstName       = "Bilbo";
                orderDisplay.LastName        = "Baggins";
                orderDisplay.OrderDate       = new DateTimeOffset(2014, 4, 14, 10, 00, 00, new TimeSpan(7, 0, 0));
                orderDisplay.ShippingAddress = addressRepository.Retrieve(1);
            }

            orderDisplay.OrderDisplayItemList = new List <OrderDisplayItem>();

            if (orderId == 10)
            {
                var orderDisplayItem = new OrderDisplayItem()
                {
                    ProductName   = "Sunflowers",
                    PurchasePrice = 15.96M,
                    OrderQuantity = 2
                };
                orderDisplay.OrderDisplayItemList.Add(orderDisplayItem);

                orderDisplayItem = new OrderDisplayItem()
                {
                    ProductName   = "Rake",
                    PurchasePrice = 6M,
                    OrderQuantity = 1
                };
                orderDisplay.OrderDisplayItemList.Add(orderDisplayItem);
            }


            return(orderDisplay);
        }
        public void RetriveOrderDisplayTest()
        {
            //Arrange
            var orderRepository = new OrderRepository();

            var expected = new OrderDisplay()
            {
                FirstName = "Rich",
                LastName = "Strong",
                OrderDate = new DateTimeOffset(2015,4,12,9,00,00, new TimeSpan(7,0,0)),

                ShippingAddress = new Address()
                {
                    AddressType = 1,
                    StreetLineOne = "Good Year",
                    StreetLineTwo = "Good Harvest",
                    City = "Brighton",
                    State = "Central UK",
                    Country = "bRIGHTON Area",
                    PostCode = "144UK"
                },

                OrderDisplayItemsList = new List<OrderDisplayItem>()
                {
                    new OrderDisplayItem()
                    {
                        ProductName = "Beef meat",
                        PurchasePrice = 8M,
                        OrderQuantity = 1

                    },

                    new OrderDisplayItem()
                    {
                        ProductName = "Sheep meat",
                        PurchasePrice = 12M,
                        OrderQuantity = 2

                    }
                }
            };
            //Act
            var actual = orderRepository.RetrieveOrderDisplay(10);

            //Assert
            Assert.AreEqual(expected.FirstName, actual.FirstName);
            Assert.AreEqual(expected.LastName, actual.LastName);
            Assert.AreEqual(expected.OrderDate, actual.OrderDate);

            Assert.AreEqual(expected.ShippingAddress.AddressType,actual.ShippingAddress.AddressType);
            Assert.AreEqual(expected.ShippingAddress.StreetLineOne, actual.ShippingAddress.StreetLineOne);
            Assert.AreEqual(expected.ShippingAddress.StreetLineTwo,actual.ShippingAddress.StreetLineTwo);
            Assert.AreEqual(expected.ShippingAddress.City,actual.ShippingAddress.City);
            Assert.AreEqual(expected.ShippingAddress.State,actual.ShippingAddress.State);
            Assert.AreEqual(expected.ShippingAddress.Country,actual.ShippingAddress.Country);
            Assert.AreEqual(expected.ShippingAddress.PostCode,actual.ShippingAddress.PostCode);

            for (int i = 0; i < 1; i++)
			{
			    Assert.AreEqual(expected.OrderDisplayItemsList[i].OrderQuantity
                    ,actual.OrderDisplayItemsList[i].OrderQuantity);
                Assert.AreEqual(expected.OrderDisplayItemsList[i].ProductName
                    ,actual.OrderDisplayItemsList[i].ProductName);
                Assert.AreEqual(expected.OrderDisplayItemsList[i].PurchasePrice
                    ,actual.OrderDisplayItemsList[i].PurchasePrice);


			}
        }