public void Setup() { _validEmployee1 = ObjectMother.ValidEmployee("emp1").WithEntityId(1); _validEmployee2 = ObjectMother.ValidEmployee("emp2").WithEntityId(2); _validEmployee3 = ObjectMother.ValidEmployee("emp3").WithEntityId(3); _validEmployee4 = ObjectMother.ValidEmployee("emp4").WithEntityId(4); _selectedEmployees = new [] { _validEmployee3, _validEmployee4 }; _selectListItemService = MockRepository.GenerateMock <ISelectListItemService>(); _availableSelectListItems = new[] { _selectListItem1, _selectListItem2, new SelectListItem { Text = "emp3", Value = "3" }, new SelectListItem { Text = "emp4", Value = "4" } }; _selectedSelectListItems = new[] { new SelectListItem { Text = "emp3", Value = "3" }, new SelectListItem { Text = "emp4", Value = "4" } }; _selectListItemService.Expect(x => x.CreateList <Employee>(null, null, false, true)).IgnoreArguments().Return(_availableSelectListItems); _selectListItemService.Expect(x => x.CreateList(_selectedEmployees, null, null, false)).IgnoreArguments().Return(_selectedSelectListItems); _selectBoxPickerService = new SelectBoxPickerService(_selectListItemService, null); _result = _selectBoxPickerService.GetPickerDto(_selectedEmployees, x => x.FullName, x => x.EntityId); }
public VendorController(IRepository repository, ISaveEntityService saveEntityService, ISelectBoxPickerService selectBoxPickerService) { _repository = repository; _saveEntityService = saveEntityService; _selectBoxPickerService = selectBoxPickerService; }
public EmailJobController(IRepository repository, ISaveEntityService saveEntityService, ISelectBoxPickerService selectBoxPickerService, ISelectListItemService selectListItemService) { _repository = repository; _saveEntityService = saveEntityService; _selectBoxPickerService = selectBoxPickerService; _selectListItemService = selectListItemService; }
public TaskController(IRepository repository, ISaveEntityService saveEntityService, ISelectListItemService selectListItemService, ISelectBoxPickerService selectBoxPickerService, IInventoryService inventoryService) { _repository = repository; _saveEntityService = saveEntityService; _selectListItemService = selectListItemService; _selectBoxPickerService = selectBoxPickerService; _inventoryService = inventoryService; }
public EmployeeController(IRepository repository, ISaveEntityService saveEntityService, IUploadedFileHandlerService uploadedFileHandlerService, ISelectBoxPickerService selectBoxPickerService, IHttpContextAbstractor httpContextAbstractor) { _repository = repository; _saveEntityService = saveEntityService; _uploadedFileHandlerService = uploadedFileHandlerService; _selectBoxPickerService = selectBoxPickerService; _httpContextAbstractor = httpContextAbstractor; }
public void Setup() { _validEmployee1 = ObjectMother.ValidEmployee("emp1").WithEntityId(1); _validEmployee2 = ObjectMother.ValidEmployee("emp2").WithEntityId(2); _selectedEmployees = new[] { _validEmployee2, _validEmployee2 }; _selectedEntities = new[]{_validEmployee1,_validEmployee2}; dto = new SelectBoxPickerDto{Selected = new[]{"1","2"}}; _repo = MockRepository.GenerateMock<IRepository>(); _repo.Expect(x => x.Find<Employee>(1)).Return(_validEmployee1); _repo.Expect(x => x.Find<Employee>(2)).Return(_validEmployee2); _selectBoxPickerService = new SelectBoxPickerService(_selectListItemService,_repo); _result = _selectBoxPickerService.GetListOfSelectedEntities<Employee>(dto); }
public void Setup() { _validEmployee1 = ObjectMother.ValidEmployee("emp1").WithEntityId(1); _validEmployee2 = ObjectMother.ValidEmployee("emp2").WithEntityId(2); _selectedEmployees = new[] { _validEmployee2, _validEmployee2 }; _selectedEntities = new[] { _validEmployee1, _validEmployee2 }; dto = new SelectBoxPickerDto { Selected = new[] { "1", "2" } }; _repo = MockRepository.GenerateMock <IRepository>(); _repo.Expect(x => x.Find <Employee>(1)).Return(_validEmployee1); _repo.Expect(x => x.Find <Employee>(2)).Return(_validEmployee2); _selectBoxPickerService = new SelectBoxPickerService(_selectListItemService, _repo); _result = _selectBoxPickerService.GetListOfSelectedEntities <Employee>(dto); }
public void Setup() { _validEmployee1 = ObjectMother.ValidEmployee("emp1").WithEntityId(1); _validEmployee2 = ObjectMother.ValidEmployee("emp2").WithEntityId(2); _validEmployee3 = ObjectMother.ValidEmployee("emp3").WithEntityId(3); _validEmployee4 = ObjectMother.ValidEmployee("emp4").WithEntityId(4); _selectedEmployees = new []{_validEmployee3,_validEmployee4}; _selectListItemService = MockRepository.GenerateMock<ISelectListItemService>(); _availableSelectListItems = new[] { _selectListItem1, _selectListItem2, new SelectListItem {Text = "emp3", Value = "3"}, new SelectListItem {Text = "emp4", Value = "4"} }; _selectedSelectListItems = new[] { new SelectListItem {Text = "emp3", Value = "3"}, new SelectListItem {Text = "emp4", Value = "4"} }; _selectListItemService.Expect(x => x.CreateList<Employee>(null, null, false,true)).IgnoreArguments().Return(_availableSelectListItems); _selectListItemService.Expect(x => x.CreateList(_selectedEmployees, null, null, false)).IgnoreArguments().Return(_selectedSelectListItems); _selectBoxPickerService = new SelectBoxPickerService(_selectListItemService, null); _result = _selectBoxPickerService.GetPickerDto(_selectedEmployees,x=>x.FullName,x=>x.EntityId); }