Exemplo n.º 1
0
        public void Can_Filter_By_DisplayName_And_Email()
        {
            // Arrange .. instantiate the component under test
            Mock<IUserRepository> mockRepo = new Mock<IUserRepository>();
            _component = new UserComponent(mockRepo.Object);

            // Act .. call the actual filter method
            var filterResults = _component.Filter(c => c.DisplayName == "galilyou1");

            // Assert .. verify that filter has been called
            mockRepo.Verify(c => c.Filter(It.IsAny<Expression<Func<User, bool>>>()), Times.Once());
        }