protected override void SetUp() { base.SetUp(); bookIndex = NewMock <IBookIndex>(); bookListViewModelBuilder = new BookListViewModelBuilder(bookIndex); }
public void TestSetup() { index01 = new BookIndex(partyOne, articleCode0, codeOrder01); index02 = new BookIndex(partyOne, articleCode0, codeOrder02); index03 = new BookIndex(partyOne, articleCode0, codeOrder03); index04 = new BookIndex(partyOne, articleCode0, codeOrder04); index05 = new BookIndex(partyOne, articleCode0, codeOrder05); index11 = new BookIndex(partyOne, articleCode1, codeOrder01); index12 = new BookIndex(partyOne, articleCode1, codeOrder02); index13 = new BookIndex(partyOne, articleCode1, codeOrder03); index14 = new BookIndex(partyOne, articleCode1, codeOrder04); index15 = new BookIndex(partyOne, articleCode1, codeOrder05); index16 = new BookIndex(partyOne, articleCode1, codeOrder06); index17 = new BookIndex(partyOne, articleCode1, codeOrder07); index21 = new BookIndex(partyOne, articleCode2, codeOrder01); index22 = new BookIndex(partyOne, articleCode2, codeOrder02); index23 = new BookIndex(partyOne, articleCode2, codeOrder03); index24 = new BookIndex(partyOne, articleCode2, codeOrder04); index25 = new BookIndex(partyOne, articleCode2, codeOrder05); index26 = new BookIndex(partyOne, articleCode2, codeOrder06); index27 = new BookIndex(partyOne, articleCode2, codeOrder07); index28 = new BookIndex(partyOne, articleCode2, codeOrder08); index29 = new BookIndex(partyOne, articleCode2, codeOrder09); }
public IBookParty GetPositionParty(IBookIndex element) { if (__positionNode == true) { return(element.GetNewPositionParty(element.Code(), element.CodeOrder())); } return(null); }
public IBookParty GetContractParty(IBookIndex element) { if (__positionNode == false && __contractNode == true) { return(element.GetNewContractParty(element.Code(), element.CodeOrder())); } return(null); }
public static IBookResult[] BuildListWithEmptyResult(IBookIndex element, IPayrollArticle article) { IBookResult result = BookResultBuilder.CreateEmptyResult(element, article); IBookResult[] resultList = BuildListWithResult(result); return(resultList); }
public void Should_Return_Free_CodeOrder_1_From_Empty_Collection() { IBookIndex[] testArray = new IBookIndex[0]; IBookIndex testIndex = TargetStream.TargetElementBuilder.BuildIndexWithDefault(testArray, partyOne, articleCode1); Assert.AreEqual(codeOrder01, testIndex.CodeOrder()); }
public virtual IBookResult[] CallEvaluate(IProcessConfig config, IEngineProfile engine, IPayrollArticle article, IBookIndex element, ITargetValues values, IResultStream results) { if (__evaluate != null) { return(__evaluate(this, config, engine, article, element, values, results)); } return(GeneralModule.EMPTY_RESULT_LIST); }
public BookIndexBuilder( IBookIndex bookIndex, IBookFactory bookFactory, ISpecificBookDataProvider[] specificBookDataProviders) { this.bookIndex = bookIndex; this.bookFactory = bookFactory; this.specificBookDataProviders = specificBookDataProviders; }
public int CompareTo(IBookIndex otherIndex) { bool equalsPartyIndex = base.isEqualToParty(otherIndex); if (equalsPartyIndex) { return(this.GetIndex().CompareTo(otherIndex.GetIndex())); } return(base.CompareTo(otherIndex)); }
public static IBookResult[] BuildSalaryBaseResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, decimal factorValue, decimal amountValue, Int32 recordWorking) { IBookResult result = BookResultBuilder.CreateMonthlyAmountPaymentsResult(concept, element, article, targets, factorValue, amountValue, recordWorking); IBookResult[] resultList = BuildListWithResult(result); return(resultList); }
public static IBookResult[] BuildIncomeGrossResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, decimal incomeValue) { IBookResult result = BookResultBuilder.CreateRecordIncomeResult(concept, element, article, targets, incomeValue); IBookResult[] resultList = BuildListWithResult(result); return(resultList); }
public BookTarget(IBookIndex bookElement, IPayrollArticle bookArticle, IPayrollConcept bookConcept, ITargetValues bookValues) { __element = bookElement; __article = bookArticle; __concept = bookConcept; __values = bookValues; }
protected override void SetUp() { base.SetUp(); bookIndex = NewMock <IBookIndex>(); bookFactory = NewMock <IBookFactory>(); provider1 = NewMock <ISpecificBookDataProvider>(); provider2 = NewMock <ISpecificBookDataProvider>(); bookIndexBuilder = new BookIndexBuilder(bookIndex, bookFactory, new [] { provider1, provider2 }); }
public void Should_Return_Free_CodeOrder_1_From_Missing_Collection() { IBookIndex[] testArray = new IBookIndex[] { index01, index02, index03, index04, index05, index21, index22, index23, index24, index25, index26, index27, index28, index29 }; IBookIndex testIndex = TargetStream.TargetElementBuilder.BuildIndexWithDefault(testArray, partyOne, articleCode1); Assert.AreEqual(codeOrder01, testIndex.CodeOrder()); }
public static string LogArticleInfo(IBookTarget target) { IPayrollArticle article = target.Article(); IBookIndex element = target.Element(); string lineDefinition = string.Format("\n--- {0} - {1} - {2} - {3}", article.ArticleName(), article.ConceptName(), article.ArticleCode(), element.ToString()); return(lineDefinition); }
public BookResult(IBookIndex element, IPayrollArticle article, IResultValues values, string[] targetValues, string[] resultValues) { __element = element; __article = article; __values = values; __targetValues = targetValues; __resultValues = resultValues; }
public void Should_Return_First_CodeOrder_1_With_Missing_8() { IBookIndex[] testArray = new IBookIndex[] { index01, index02, index04, index05, index11, index12, index13, index14, index15, index16, index17, index21, index22, index23, index24, index26, index27, index28, index29 }; IBookIndex testIndex = TargetStream.TargetElementBuilder.BuildIndexWithFirst(testArray, partyOne, articleCode1); Assert.AreEqual(codeOrder01, testIndex.CodeOrder()); }
static public IBookTarget BuildTargetFromElement(IBookIndex element, ITargetValues values, IProcessConfig config) { uint articleCode = element.Code(); IPayrollArticle targetArticle = config.FindArticle(articleCode); IPayrollConcept targetConcept = config.FindConcept(targetArticle.ConceptCode()); IBookTarget target = TargetFactory.BuildTargetWithValues(element, targetArticle, targetConcept, values); return(target); }
public IBookParty GetNextTargetParty(IBookIndex lastIndex) { if (__positionNode == false && __contractNode == true) { return(lastIndex.GetNewContractParty(lastIndex.Code(), lastIndex.CodeOrder())); } else if (__positionNode == true) { return(lastIndex.GetNewPositionParty(lastIndex.Code(), lastIndex.CodeOrder())); } return(lastIndex.GetParty()); }
public static Tuple <IBookIndex, IDictionary <IBookIndex, IBookTarget> > AddTargetBySymbol( IDictionary <IBookIndex, IBookTarget> targets, IBookParty party, SymbolName articleName, ITargetValues values, IProcessConfig config) { IBookIndex newIndex = TargetElementBuilder.BuildIndexWithFirst(targets.Keys, party, articleName.Code); KeyValuePair <IBookIndex, IBookTarget> pairToMerge = TargetPairComposer .ComposeTarget(party, articleName, newIndex, values, config); var targetIndex = pairToMerge.Key; var targetValue = pairToMerge.Value; var bookTargets = TargetsDictComposer.MergeDictWithTargetPair(targets, targetIndex, targetValue); return(Tuple.Create <IBookIndex, IDictionary <IBookIndex, IBookTarget> >(targetIndex, bookTargets)); }
public static string LogResultInfo(IBookResult result) { IPayrollArticle article = result.Article(); IBookIndex element = result.Element(); string lineDefinition = string.Format("\n--- {0} - {1} - {2} - {3}", article.ArticleName(), article.ConceptName(), article.ArticleCode(), element.ToString()); foreach (var targetValue in result.TargetValues()) { lineDefinition += string.Format("\n\t--> {0} - {1}", targetValue, LogValueInfo(targetValue, result.Values())); } foreach (var resultValue in result.ResultValues()) { lineDefinition += string.Format("\n\t<-- {0} - {1}", resultValue, LogValueInfo(resultValue, result.Values())); } return(lineDefinition); }
public static bool IsEqualToPositionParty(IBookParty position, IBookIndex element) { return(element.ContractIndex().Equals(position.ContractIndex()) && element.PositionIndex().Equals(position.PositionIndex())); }
public static bool IsEqualToContractParty(ICodeIndex contract, IBookIndex element) { return(element.ContractIndex().Equals(contract)); }
public static bool IsEqualToContractArticle(ICodeIndex contract, IBookIndex element) { return(element.GetIndex().Equals(contract)); }
public static IBookResult CreateRecordTimeResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, Int32 timeValue) { IResultValues results = ResultValueBuilder.BuildRecordTimeResult(targets, timeValue); return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues())); }
public static IBookResult CreateTimesheetScheduleResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, Int32[] timeTable) { IResultValues results = ResultValueBuilder.BuildTimesheetScheduleResult(targets, timeTable); return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues())); }
public static IBookResult CreatePositionEmplTermResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, uint dayFromOrdinal, uint dayEndsOrdinal) { IResultValues results = ResultValueBuilder.BuildPositionEmplTermResult(targets, dayFromOrdinal, dayEndsOrdinal); return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues())); }
public static IBookResult CreateCloneResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets) { IResultValues results = ResultValueBuilder.BuildTargetResult(targets); return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues())); }
public static IBookResult CreateAmountDeductedResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, decimal amountValue) { IResultValues results = ResultValueBuilder.BuildAmountDeductedResult(targets, amountValue); return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues())); }
public static IBookResult CreateMonthlyAmountPaymentsResult(IPayrollConcept concept, IBookIndex element, IPayrollArticle article, ITargetValues targets, decimal factorValue, decimal amountValue, Int32 recordHours) { IResultValues results = ResultValueBuilder.BuildMonthlyAmountPaymentsResult(targets, factorValue, amountValue, recordHours); return(new BookResult(element, article, results, concept.TargetValues(), concept.ResultValues())); }