public void TestLotFinalize()
        {
            var factory = new QualificationApplicationFactory();
            var uuid    = Guid.NewGuid();
            var lotIds  = new [] { "Lot 1", "Lot 2" };
            var qar     = factory.CreateEspd2_1_1ExtendedRequest(
                new IdentifierType("TEST-123")
            {
                SchemeAgencyID = "TEST"
            },
                new IdentifierType("TEST-REF-111")
            {
                SchemeAgencyID = "TEST"
            },
                uuid,
                lotIds, false);

            var suitabilityCriterion = new CriterionSpecification().SelectionCriteria.Suitability.First();

            qar.TenderingCriteria = qar.TenderingCriteria = new[] { suitabilityCriterion };

            qar.FinalizeDocument(lotIds);

            var assertedCriteria = qar.TenderingCriteria.Last();

            Assert.AreEqual(suitabilityCriterion.Name, assertedCriteria.Name);

            var lotProperties =
                assertedCriteria.DescendantProperties()
                .Where(p => p.TypeCode.Equals(CriterionElementType.Requirement) && Equals(p.ValueDataTypeCode, ResponseDataTypeCode.LotIdentifier)).ToArray();

            Assert.AreEqual(2, lotProperties.Length, "Should have two lot properties");
            Assert.AreEqual("Lot 1", lotProperties[0].ExpectedID.Value);
            Assert.AreEqual("Lot 2", lotProperties[1].ExpectedID.Value);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Generating resources");

            const string lang = "name-eng";

            // get code lists
            foreach (var codeListId in CodeListIds.All)
            {
                CreateTypeCodeList(codeListId, lang);
            }

            // get tendering criteria
            var criterionSpecification = new CriterionSpecification().AllCriteria.ToArray();

            WriteToFile(criterionSpecification, $"{ToLowerFirstChar(nameof(CriterionSpecification))}.json");

            // copy translation
            var espdPath   = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "Espd");
            var sourceFile = Path.GetFullPath(Path.Combine(espdPath, "Localisation", "translations.default.json"));
            var targetPath = Path.GetFullPath(Path.Combine(espdPath, "typings", "translations.default.json"));

            Console.WriteLine("writing file to path: " + targetPath);
            File.Copy(sourceFile, targetPath, true);
        }
        public void TestFinalize_NoSelecedLots()
        {
            var factory = new QualificationApplicationFactory();
            var uuid    = Guid.NewGuid();
            var qar     = factory.CreateEspd2_1_1ExtendedRequest(new IdentifierType("TEST-123")
            {
                SchemeAgencyID = "TEST"
            },
                                                                 new IdentifierType("TEST-REF-111")
            {
                SchemeAgencyID = "TEST"
            }, uuid, new string[0], false);
            var suitabilityCriterion = new CriterionSpecification().SelectionCriteria.Suitability.First();

            qar.TenderingCriteria = qar.TenderingCriteria.Union(new[] { suitabilityCriterion }).ToArray();
            var firstPropertyId = qar.TenderingCriteria[0].TenderingCriterionPropertyGroups[0].TenderingCriterionProperties[0]
                                  .ID.Value;

            qar.FinalizeDocument(new string[0]);

            var firstPropertyIdAfter = qar.TenderingCriteria[0].TenderingCriterionPropertyGroups[0]
                                       .TenderingCriterionProperties[0].ID.Value;
            var assertedCriteria = qar.TenderingCriteria.Last();

            Assert.AreEqual(suitabilityCriterion.Name, assertedCriteria.Name);
            Assert.AreNotEqual(firstPropertyId, firstPropertyIdAfter, "Id, should not be the same");

            var lotIds = assertedCriteria.DescendantProperties()
                         .Where(p => p.TypeCode.Equals(CriterionElementType.Requirement) && Equals(p.ValueDataTypeCode, ResponseDataTypeCode.LotIdentifier));

            Assert.IsTrue(lotIds.All(id => id.ExpectedID == "0"), "Lot id:s should have been set to \"0\"");
        }
        public void TestLotFinalize_SingleLot_QuestionLots_NoValuesSet()
        {
            var factory = new QualificationApplicationFactory();
            var uuid    = Guid.NewGuid();
            var lotIds  = new[] { "0" };
            var qar     = factory.CreateEspd2_1_1ExtendedRequest(
                new IdentifierType("TEST-123")
            {
                SchemeAgencyID = "TEST"
            },
                new IdentifierType("TEST-REF-111")
            {
                SchemeAgencyID = "TEST"
            },
                uuid,
                lotIds, false);

            var referenceCriterion = new CriterionSpecification().SelectionCriteria.References.First();

            qar.TenderingCriteria = qar.TenderingCriteria = new[] { referenceCriterion };

            qar.FinalizeDocument(lotIds);

            var assertedCriteria = qar.TenderingCriteria.Last();

            Assert.AreEqual(referenceCriterion.Name, assertedCriteria.Name);

            var lotQuestionProperties =
                assertedCriteria.DescendantProperties()
                .Where(p => p.TypeCode.Equals(CriterionElementType.Question) &&
                       Equals(p.ValueDataTypeCode, ResponseDataTypeCode.LotIdentifier)).ToArray();

            Assert.AreEqual(1, lotQuestionProperties.Length, "Should have one question lot property");
            Assert.IsNull(lotQuestionProperties[0].ExpectedID, "lotQuestionProperties[0].ExpectedID == null");
        }
        public void TestTranslationCriteria()
        {
            var translationDictionary = new Dictionary <string, string>
            {
                { "convictions.participationInCriminalOrganisation.name", "Participation in a criminal organisation" },
                { "convictions.participationInCriminalOrganisation.description", "Has the economic operator breached its obligations relating to the payment of taxes, both in the country in which it is established and in Member State of the contracting authority or contracting entity if other than the country of establishment?" }
            };

            var translator             = new Translator(translationDictionary);
            var criterionSpecification = new CriterionSpecification();
            var criterion           = criterionSpecification.ExclusionGrounds.Convictions.First();
            var translatedCriterion = translator.TranslateCriterion(criterion);

            Assert.AreEqual("Participation in a criminal organisation", translatedCriterion.Name);
            Assert.AreEqual("Has the economic operator breached its obligations relating to the payment of taxes, both in the country in which it is established and in Member State of the contracting authority or contracting entity if other than the country of establishment?", translatedCriterion.Description.First());
        }
        public void TestExclusionCriteriaMisinterpretation()
        {
            var translationDictionary = LocalisationHelper.ParseDefaultLocalisation();
            var translator            = new Translator(translationDictionary);

            var criterionSpecification = new CriterionSpecification();
            var criterion = criterionSpecification.ExclusionGrounds.Misinterpretation.First();

            var translatedCriterion = translator.TranslateCriterion(criterion);

            Assert.AreEqual("Guilty of misinterpretation, withheld information, unable to provide required documents and obtained confidential information of this procedure", criterion.Name);
            AssertDescription(new[] { "Can the economic operator confirm that:",
                                      "a) It has been guilty of serious misrepresentation in supplying the information required for the verification of the absence of grounds for exclusion or the fulfilment of the selection criteria,",
                                      "b) It has withheld such information,",
                                      "c) It has not been able, without delay, to submit the supporting documents required by a contracting authority or contracting entity, and",
                                      "d) It has undertaken to unduly influence the decision making process of the contracting authority or contracting entity, to obtain confidential information that may confer upon it undue advantages in the procurement procedure or to negligently provide misleading information that may have a material influence on decisions concerning exclusion, selection or award?" }, translatedCriterion.Description);
        }
        public void TestExclusionCriteria()
        {
            var translationDictionary = LocalisationHelper.ParseDefaultLocalisation();
            var translator            = new Translator(translationDictionary);

            var criterionSpecification = new CriterionSpecification();
            var criterion = criterionSpecification.ExclusionGrounds.Contributions.First();

            var translatedCriterion = translator.TranslateCriterion(criterion);

            Assert.AreEqual("Payment of taxes", criterion.Name);
            AssertDescription("Has the economic operator breached its obligations relating to the payment of taxes, both in the country in which it is established and in Member State of the contracting authority or contracting entity if other than the country of establishment?", translatedCriterion.Description);


            Assert.AreEqual("Your answer?", criterion.TenderingCriterionPropertyGroups.First().SubsidiaryTenderingCriterionPropertyGroups.First().TenderingCriterionProperties.First().Description);
            Assert.AreEqual("Country or member state concerned", criterion.TenderingCriterionPropertyGroups.First().SubsidiaryTenderingCriterionPropertyGroups.First().SubsidiaryTenderingCriterionPropertyGroups.First().TenderingCriterionProperties.First().Description);
        }