public CreateSaleViewModelFactory( IGetCustomersListQuery customersQuery, IGetEmployeesListQuery employeesQuery, IGetProductsListQuery productsQuery) { _customersQuery = customersQuery; _employeesQuery = employeesQuery; _productsQuery = productsQuery; }
public void EmployeeControllerTests_ConstructorShouldReturnList_No_Error() { var employee = new EmployeeModel() { Id = 1, Name = "William Han" }; _mocker.GetMock <IGetEmployeesListQuery>() .Setup(p => p.Execute()) .Returns(new List <EmployeeModel> { employee }); _query = _mocker.Create <IGetEmployeesListQuery>(); var controller = new EmployeesController(_query); //System.Web.Http.Results.OkNegotiatedContentResult<System.Collections.Generic.IEnumerable<Application.Employees.Queries.EmployeeModel>> var results = controller.Get() as System.Web.Http.Results.OkNegotiatedContentResult <System.Collections.Generic.IEnumerable <EmployeeModel> >; Assert.AreEqual(results.Content.ToList().Single(), employee); }
public EmployeesController(IGetEmployeesListQuery query) { _query = query; }