コード例 #1
0
        public void Should_RegisterTheOrderPlaced()
        {
            var customerService = new CustomerServiceDI();
            var order = new Order{DatePurchased = new DateTime(2014,1,1),ID = 1,ItemDescription = "Table"};

            customerService.RegisterNewOrder(order);

            var orderRepository = new OrderRepositoryDi();
            var orderRetreived = orderRepository.FindById(1);

            Assert.That(orderRetreived.ID,Is.EqualTo(order.ID));
        }
コード例 #2
0
        public void Should_PlaceaNewOrder()
        {
            var customerService = new CustomerServiceDI();
            var order = new Order {DatePurchased = new DateTime(2014, 1, 1), ID = 3, ItemDescription = @"bench"};

            customerService.RegisterNewOrder(order);

            //retreive it from database
            var orderRepositoryDi = new OrderRepositoryDi();
            var retreivedOrder = orderRepositoryDi.FindById(order.ID);

            Assert.AreEqual(order.ID, retreivedOrder.ID);
        }