示例#1
0
        public void Test_GetAll_Return_Right_Number_Of_Objects()
        {
            //arrange
            OrderService service = new OrderService(_unitOfWork.Object);

            //act
            IEnumerable<OrderDTO> orders = service.GetAll();

            //assert
            Assert.AreEqual(2, orders.Count());
        }
示例#2
0
        public void Test_Add_Call_Insert()
        {
            //arrange
            OrderService service = new OrderService(_unitOfWork.Object);
            OrderDTO order = new OrderDTO() { OrderId = 1, CustomerId = 1};

            //act
            service.Add(order);

            //assert
            _ordersRepository.Verify( o => o.Insert(It.IsAny<Order>()), Times.Once() );
        }