public void Test_Execute_Should_Return_List_Of_Customers() { //ARRANGE IDbSet <Customer> mockData = _customers.GetQueryableMockDbSet(); var mockDatabase = new Mock <IDatabaseService>(); mockDatabase.Setup(c => c.Customers).Returns(mockData); var mockFactory = new Mock <ICustomerFactory>(); mockFactory.Setup(c => c.Create(It.IsAny <CustomerModel>())); var customerCommand = new CreateCustomerCommand(mockDatabase.Object, mockFactory.Object); //ACT customerCommand.ExecuteAsync(new CustomerModel()); //ASSERT mockFactory.VerifyAll(); }