public void AddCallsAddFromRepository()
        {
            var testItem = ProductObjectMother.CreateAvailableProduct(1);

            ProductService.Add(testItem);
            ProductRepositoryMock.Verify(x => x.Add(testItem), Times.Once());
        }
        public void UpdateCallsUpdateFromRepository()
        {
            var product = ProductObjectMother.CreateProductWithNoId();

            ProductService.Add(product);
            product.Name = "New name";
            ProductService.Update(product);
            ProductRepositoryMock.Verify(x => x.Update(product));
        }
 public void GetPageOrderedByPriceDescCallsGetOrderedPageFromRepository()
 {
     ProductService.GetPageOrderedByPriceDesc(1, 1);
     ProductRepositoryMock.Verify(x => x.GetOrderedPage(
                                      1, 1, It.IsAny <Func <Product, IComparable> >(), false), Times.Once());
 }
 public void DeleteCallsDeleteFromRepository()
 {
     ProductService.Delete(1);
     ProductRepositoryMock.Verify(x => x.Delete(1), Times.Once());
 }
 public void FindAllCallsFindAllFromRepository()
 {
     ProductService.FindAll();
     ProductRepositoryMock.Verify(x => x.FindAll(), Times.Once());
 }