示例#1
0
        public void AddCallsAddFromRepository()
        {
            var testItem = CustomerObjectMother.CreateCustomer(1);

            CustomerService.Add(testItem);
            CustomerRepositoryMock.Verify(x => x.Add(testItem), Times.Once());
        }
示例#2
0
        public void UpdateCallsUpdateFromRepository()
        {
            var customer = CustomerObjectMother.CreateCustomerWithNoId();

            CustomerService.Add(customer);
            customer.Name = "New name";
            CustomerService.Update(customer);
            CustomerRepositoryMock.Verify(x => x.Update(customer));
        }
示例#3
0
 public void DeleteCallsDeleteFromRepository()
 {
     CustomerService.Delete(1);
     CustomerRepositoryMock.Verify(x => x.Delete(1), Times.Once());
 }
示例#4
0
 public void GetPageCallsGetOrderedPageFromRepository()
 {
     CustomerService.GetPage(1, 1);
     CustomerRepositoryMock.Verify(x => x.GetOrderedPage(
                                       1, 1, It.IsAny <Func <Customer, IComparable> >(), true), Times.Once());
 }
示例#5
0
 public void FindAllCallsFindAllFromRepository()
 {
     CustomerService.FindAll();
     CustomerRepositoryMock.Verify(x => x.FindAll(), Times.Once());
 }