示例#1
0
        public void CustomerService_GetAll()
        {
            // When.
            CustomerService.GetAll();

            // Then.
            CustomerManagerMock.Verify(e => e.GetAll(), Times.Once);
        }
示例#2
0
        public void CustomerService_Create()
        {
            // Given.
            var customer = Customers[0];

            // When.
            CustomerService.Create(customer);

            // Then.
            CustomerManagerMock.Verify(e => e.Create(It.Is <Customer>(c => c == customer)), Times.Once);
        }
示例#3
0
        public void CustomerService_Get()
        {
            // Given.
            var customer = Customers[0].Id;

            // When.
            CustomerService.Get(customer);

            // Then.
            CustomerManagerMock.Verify(e => e.Get(It.Is <int>(s => s == customer)), Times.Once);
        }
示例#4
0
        public void CustomerService_Update()
        {
            // Given.
            int id       = 1;
            var customer = Customers[id];

            // When.
            CustomerService.Update(customer);

            // Then.
            CustomerManagerMock.Verify(e => e.Update(It.Is <Customer>(c => c == customer)), Times.Once);
        }