public async void EmpresaService_Buscar_DeveExecutarComSucesso() { // Arrange Expression <Func <ERP.Business.Models.Empresa, bool> > predicate = (x) => x.CnpjCpfDi != string.Empty; _empresaTestsAutoMockerFixture.Mocker.GetMock <IEmpresaRepository>().Setup(c => c.Buscar(predicate)) .Returns(Task.FromResult(_empresaTestsAutoMockerFixture.ObterVariados())); // Act var registro = await _empresaService.Buscar(predicate); // Assert _empresaTestsAutoMockerFixture.Mocker.GetMock <IEmpresaRepository>().Verify(r => r.Buscar(predicate), Times.Once); Assert.True(registro != null); }