public async void SearchRobot_Ok() { //Arrange var robot = new Robot { Id = Guid.NewGuid(), Name = "Test" }; m_repositoryMock.Setup(t => t.SearchAsync(It.IsAny <Pagination>(), It.IsAny <Ordering>(), It.IsAny <IFilter <Robot> >())) .ReturnsAsync(new Tuple <int, List <Robot> >(1, new List <Robot> { robot })); //Act var(count, robots) = await m_robotService.SearchRobotAsync(new Pagination(), new Ordering(), new RobotFilter { SearchTerm = robot.Id.ToString() }); //Assert m_repositoryMock.Verify(t => t.SearchAsync(It.IsAny <Pagination>(), It.IsAny <Ordering>(), It.IsAny <RobotFilter>()), Times.Once); Assert.Equal(1, count); Assert.Equal(robot, robots.First()); }