public async Task GetCustomersReturnsAllCustomers() { var options = new DbContextOptionsBuilder <CustomerDbContext>() .UseInMemoryDatabase(nameof(GetCustomersReturnsAllCustomers)) .Options; var dbContext = new CustomerDbContext(options); //Mock Object for the mapper var customerProfile = new CustomerProfile(); var configuration = new MapperConfiguration(cfg => cfg.AddProfile(customerProfile)); var mapper = new Mapper(configuration); var customerProvider = new CustomerProvider(dbContext, null, mapper); var customer = await customerProvider.GetCustomersAsync(); Assert.True(customer.IsSuccess); Assert.True(customer.customers.Any()); Assert.Null(customer.ErrorMessage); }