public void CreateResponseFromRequest()
        {
            var model   = new CriterionFactory();
            var request = Create.CriteriaTaxonomyExtendedV2_1_1;

            var factory = new QualificationApplicationFactory();
            var espdUrl = "http://localhost/espd/request/12345";

            var response = factory.CreateEspd2_1_1ExtendedResponse(
                request,
                Create.EconomicOperatorParty(),
                new EuComGrowId(Guid.NewGuid()),
                Guid.NewGuid(),
                espdUrl
                );

            // Test references
            Assert.AreEqual(2, response.AdditionalDocumentReferences.Length, "Should have 2 references");
            var reference = response.AdditionalDocumentReferences[1];

            Assert.AreEqual(request.ID.Value, reference.ID.Value);
            Assert.AreEqual(request.UUID.Value, reference.UUID.Value);
            Assert.AreEqual("ESPD_REQUEST", reference.DocumentTypeCode.Value);
            Assert.AreEqual(request.IssueDate.Value, reference.IssueDate.Value);
            Assert.AreEqual(request.IssueTime.ToString(), reference.IssueTime.ToString());

            // Test Lot responses init
            Assert.AreEqual(1, response.TenderingCriterionResponses.Length, "Should have one response initialized");
            var criterionResponse = response.TenderingCriterionResponses[0];

            Assert.AreEqual("0", criterionResponse.ResponseValue?[0].ResponseID.Value, "Lot id should be set to 0");
        }
        public void CreateResponseFromRequest_WithLots()
        {
            var model   = new CriterionFactory();
            var request = Create.CriteriaTaxonomyExtendedV2_1_1;

            request.ProcurementProjectLots = new [] {
                new ProcurementProjectLot()
                {
                    ID = new Hilma.UBL.UnqualifiedDataTypes.IdentifierType("1"),
                },
                new ProcurementProjectLot()
                {
                    ID = new Hilma.UBL.UnqualifiedDataTypes.IdentifierType("2"),
                }
            };
            var factory = new QualificationApplicationFactory();
            var espdUrl = "http://localhost/espd/request/12345";

            var response = factory.CreateEspd2_1_1ExtendedResponse(
                request,
                Create.EconomicOperatorParty(),
                new EuComGrowId(Guid.NewGuid()),
                Guid.NewGuid(),
                espdUrl
                );

            // Test Lot responses no init
            Assert.AreEqual(0, response.TenderingCriterionResponses.Length, "Should have no responses initialized because of lots");
        }
예제 #3
0
        public static QualificationApplicationResponse QualificationApplicationResponse(IEnumerable <TenderingCriterion> additionalCriteria = null)
        {
            var request = CriteriaTaxonomyExtendedV2_1_1;

            request.AdditionalDocumentReferences = new AdditionalDocumentReference[] {
                new AdditionalDocumentReference
                {
                    ID = new IdentifierType
                    {
                        Value          = "2020/S 100-000001",
                        SchemeAgencyID = "EU-COM-OP"
                    },
                    DocumentTypeCode = new EuComGrowCodeType
                    {
                        ListID        = "DocRefContentType",
                        ListAgencyID  = "EU-COM-GROW",
                        ListVersionID = "2.1.1",
                        Value         = "TED_CN"
                    },
                    Attachment = new Attachment
                    {
                        ExternalReference = new ExternalReference
                        {
                            URI = new IdentifierType
                            {
                                Value = "http://ted.europa.eu"
                            },
                            FileName    = "Hankinta X",
                            Description = new[]
                            {
                                "Hankinta X",
                                "0000/S 000-000000",
                            }
                        }
                    }
                }
            };

            if (additionalCriteria != null)
            {
                request.TenderingCriteria = request.TenderingCriteria.Union(additionalCriteria).ToArray();
            }

            var factory  = new QualificationApplicationFactory();
            var espdUrl  = "http://localhost/espd/request/12345";
            var response = factory.CreateEspd2_1_1ExtendedResponse(
                request,
                EconomicOperatorParty(),
                new EuComGrowId(Guid.NewGuid()),
                Guid.NewGuid(),
                espdUrl
                );

            var evidences = new[]
            {
                new Evidence()
                {
                    ID                = EuComGrowId.Random(),
                    Description       = new[] { "Evidence stuff" },
                    DocumentReference = new DocumentReference[]
                    {
                        new DocumentReference()
                        {
                            ID          = EuComGrowId.Random(),
                            IssuerParty = new Party()
                            {
                                PartyName = new PartyName()
                                {
                                    Name = "Issuer"
                                }
                            }
                        }
                    }
                }
            };

            response.Evidences = evidences;
            response.TenderingCriterionResponses = CreateResponses(response).ToArray();

            return(response);
        }