public void CreateDefaultWageParameter_IfInstanceOfEmployeeIsNewAndCategoryOfEmployeeIsOffice_ThenCreateManualWageParameter() { //arrange IWageParametersProvider wageParametersProvider = Substitute.For <IWageParametersProvider>(); IWageCalculationRepository wageCalculationRepository = Substitute.For <IWageCalculationRepository>(); var employee = new Employee { WageCalculationRepository = wageCalculationRepository, Category = EmployeeCategory.office }; WageDistrictLevelRates levelRates = Substitute.For <WageDistrictLevelRates>(); wageCalculationRepository.DefaultLevelForNewEmployees(null).ReturnsForAnyArgs(levelRates); IInteractiveService interactiveService = Substitute.For <IInteractiveService>(); //act employee.CreateDefaultWageParameter(wageCalculationRepository, wageParametersProvider, interactiveService); //assert Assert.That(employee.ObservableWageParameters.Count(), Is.EqualTo(1)); Assert.That( employee.ObservableWageParameters .FirstOrDefault() .WageParameterItem .WageParameterItemType, Is.EqualTo(WageParameterItemTypes.Manual) ); }
public void CreateDefaultWageParameter_IfInstanceOfEmployeeIsNotNew_ThenDoNothing() { //arrange IWageParametersProvider wageParametersProvider = Substitute.For <IWageParametersProvider>(); IWageCalculationRepository wageCalculationRepository = Substitute.For <IWageCalculationRepository>(); var employee = new Employee { Id = 1 }; employee.WageParameters.Add( new EmployeeWageParameter() { StartDate = new DateTime(2000, 01, 01), WageParameterItem = new FixedWageParameterItem() } ); IInteractiveService interactiveService = Substitute.For <IInteractiveService>(); //act employee.CreateDefaultWageParameter(wageCalculationRepository, wageParametersProvider, interactiveService); //assert Assert.That(employee.ObservableWageParameters.Count(), Is.EqualTo(1)); Assert.That( employee.ObservableWageParameters .FirstOrDefault() .StartDate, Is.EqualTo(new DateTime(2000, 01, 01)) ); }
public SalaryRatesReport(IUnitOfWorkFactory unitOfWorkFactory, IWageParametersProvider wageParametersProvider, ICommonServices commonServices) { _wageParametersProvider = wageParametersProvider ?? throw new ArgumentNullException(nameof(wageParametersProvider)); _commonServices = commonServices ?? throw new ArgumentNullException(nameof(commonServices)); Build(); UoW = unitOfWorkFactory.CreateWithoutRoot(); SalaryRateFilterNode salaryRateFilterNodeAlias = null; WageDistrictLevelRates wageDistrictLevelRatesAlias = null; _salaryRateFilterNodes = new GenericObservableList <SalaryRateFilterNode>(UoW.Session .QueryOver(() => wageDistrictLevelRatesAlias).Where(x => !x.IsArchive) .SelectList(list => list .Select(() => wageDistrictLevelRatesAlias.Name).WithAlias(() => salaryRateFilterNodeAlias.Name) .Select(() => wageDistrictLevelRatesAlias.Id).WithAlias(() => salaryRateFilterNodeAlias.WageId)) .TransformUsing(Transformers.AliasToBean <SalaryRateFilterNode>()).List <SalaryRateFilterNode>()); treeViewSalaryProperties.ColumnsConfig = FluentColumnsConfig <SalaryRateFilterNode> .Create() .AddColumn("Название").AddTextRenderer(x => x.Name) .AddColumn("").AddToggleRenderer(x => x.Selected) .Finish(); treeViewSalaryProperties.ItemsDataSource = _salaryRateFilterNodes; }
public PremiumRaskatGAZelleWageModel(IEmployeeRepository employeeRepository, IWageParametersProvider wageParametersProvider, IPremiumRaskatGAZelleParametersProvider premiumRaskatGaZelleParametersProvider, RouteList routeList) { this.employeeRepository = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository)); this.wageParametersProvider = wageParametersProvider ?? throw new ArgumentNullException(nameof(wageParametersProvider)); this.premiumRaskatGAZelleParametersProvider = premiumRaskatGaZelleParametersProvider ?? throw new ArgumentNullException(nameof(premiumRaskatGaZelleParametersProvider)); this.routeList = routeList ?? throw new ArgumentNullException(nameof(routeList)); }
public CarsExploitationReport( IUnitOfWorkFactory unitOfWorkFactory, IEntityAutocompleteSelectorFactory carAutocompleteSelectorFactory, IWageParametersProvider wageParametersProvider, IInteractiveService interactiveService) { if (unitOfWorkFactory == null) { throw new ArgumentNullException(nameof(unitOfWorkFactory)); } this.carAutocompleteSelectorFactory = carAutocompleteSelectorFactory ?? throw new ArgumentNullException(nameof(carAutocompleteSelectorFactory)); this.wageParametersProvider = wageParametersProvider ?? throw new ArgumentNullException(nameof(wageParametersProvider)); this.interactiveService = interactiveService ?? throw new ArgumentNullException(nameof(interactiveService)); Build(); UoW = unitOfWorkFactory.CreateWithoutRoot(); Configure(); }
public WageParameterService(IWageCalculationRepository wageCalculationRepository, IWageParametersProvider wageParametersProvider) { this.wageCalculationRepository = wageCalculationRepository ?? throw new ArgumentNullException(nameof(wageCalculationRepository)); this.wageParametersProvider = wageParametersProvider ?? throw new ArgumentNullException(nameof(wageParametersProvider)); }