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()); }
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() ); }