Esempio n. 1
0
        public void ValidateCompleteResponse_Pass()
        {
            // Arrange
            var response = Create.QualificationApplicationResponse();

            // Act
            var document  = response.Serialize();
            var validator = new EspdXmlValidator();
            var result    = validator.ValidateQualificationApplicationResponse(document);


            // Assert
            foreach (var error in result.Errors)
            {
                Console.WriteLine("Error:" + error);
            }
            Console.WriteLine(document);
            Assert.IsTrue(result.IsSuccess, "Validation should pass");
        }
Esempio n. 2
0
        public void ExportCompleteResponse_Pass()
        {
            // Arrange
            var response = Create.QualificationApplicationResponse();

            // Act
            var document  = response.Serialize();
            var validator = new EspdXmlValidator();
            var result    = validator.ValidateQualificationApplicationResponse(document);
            var filePath  = Path.Combine(Path.GetTempPath(), $"EspdResponseTestResult.xml");

            Console.WriteLine("Write file to: " + filePath);
            document.Save(filePath);

            // Assert
            foreach (var error in result.Errors)
            {
                Console.WriteLine("Error:" + error);
            }
            Assert.IsTrue(result.IsSuccess, "Validation should pass");
        }
Esempio n. 3
0
        public void ValidateInvalidResponse_Fail()
        {
            // Arrange
            var response = Create.QualificationApplicationResponse();

            response.Evidences = new Evidence[0];
            response.TenderingCriterionResponses = new TenderingCriterionResponse[0];

            // Act
            var document  = response.Serialize();
            var validator = new EspdXmlValidator();
            var result    = validator.ValidateQualificationApplicationResponse(document);


            // Assert
            foreach (var error in result.Errors)
            {
                Console.WriteLine("Error:" + error);
            }
            Console.WriteLine(document);
            Assert.IsFalse(result.IsSuccess, "Validation should fail");
        }