예제 #1
0
        public void AddCallsAddFromRepository()
        {
            var testItem = OrderObjectMother.CreateOrderWithItems(1);

            OrderService.Add(testItem);
            OrderRepositoryMock.Verify(x => x.Add(testItem), Times.Once());
        }
예제 #2
0
        public void UpdateCallsUpdateFromRepository()
        {
            var order = OrderObjectMother.CreateEmptyOrderWithNoId();

            OrderService.Add(order);
            order.CustomerId = 2137;
            OrderService.Update(order);
            OrderRepositoryMock.Verify(x => x.Update(order));
        }
예제 #3
0
 public void FindAllOfCustomerCallsFinAllOfCustomerFromRepository()
 {
     OrderService.FindAllOfCustomer(1);
     OrderRepositoryMock.Verify(x => x.FindAllOfCustomer(1), Times.Once());
 }
예제 #4
0
 public void DeleteCallsDeleteFromRepository()
 {
     OrderService.Delete(1);
     OrderRepositoryMock.Verify(x => x.Delete(1), Times.Once());
 }
예제 #5
0
 public void GetPageCallsGetOrderedPageFromRepository()
 {
     OrderService.GetPage(1, 1);
     OrderRepositoryMock.Verify(x => x.GetOrderedPage(
                                    1, 1, It.IsAny <Func <Order, IComparable> >(), true), Times.Once());
 }
예제 #6
0
 public void FindAllCallsFindAllFromRepository()
 {
     OrderService.FindAll();
     OrderRepositoryMock.Verify(x => x.FindAll(), Times.Once());
 }