Exemplo n.º 1
0
        public void Should_Return_UnknownConcept_From_Models()
        {
            SymbolName testSpecName = ConceptSymbolName.REF_UNKNOWN;

            IPayrollConcept testConcept = testConfig.FindConcept(testSpecName.Code);

            Type testTypeOfConcept = testConcept.GetType();

            Assert.AreSame(typeof(UnknownConcept), testTypeOfConcept);

            Assert.AreEqual(testConcept.ConceptCode(), testSpecName.Code);
        }
Exemplo n.º 2
0
            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);
            }
Exemplo n.º 3
0
            public static IDictionary <IBookIndex, IBookTarget> BuildEvaluationStream(IDictionary <IBookIndex, IBookTarget> initialStream,
                                                                                      IBookParty[] contracts, IBookParty[] positions, IPayrollArticle article, IProcessConfig configModule)
            {
                ITargetValues emptyValues = null;

                IPayrollConcept concept = configModule.FindConcept(article.ConceptCode());

                IBookParty[] parties = concept.GetTargetParties(BookParty.GetEmpty(), contracts, positions);

                var targets = parties.Aggregate(initialStream,
                                                (agr, party) => BuildArticleTarget(initialStream, party, article, emptyValues, configModule));

                return(targets);
            }
Exemplo n.º 4
0
        public ITargetStream AddTargetIntoSubLevel(SymbolName article, ITargetValues values, IProcessConfig config)
        {
            uint articleCode = article.Code;

            IPayrollArticle targetArticle = config.FindArticle(articleCode);

            uint conceptCode = targetArticle.ConceptCode();

            IPayrollConcept targetConcept = config.FindConcept(conceptCode);

            IBookParty addParty = targetConcept.GetTargetParty(LastParty());

            var retTuple = TargetsTupleComposer.AddTargetBySymbol(Targets(),
                                                                  addParty, article, values, config);

            var nextFacts = retTuple.Item2;

            var nextIndex = retTuple.Item1;

            var nextParty = targetConcept.GetNextTargetParty(nextIndex);

            return(new TargetStream(nextFacts, nextParty, nextIndex));
        }