Issue with XmlValidationStep

May 2, 2012 at 12:47 PM

Hi Team

I am new to the BizUnit Framework. I have been playing around with the framework to do the unit testing of my project.

i am having two issue.

1) Suppose i am using the xmlValidation steps to validate the xml against the schema. If the schema contain wrong namespace, even then xmlstep is working successfully. I expect the step to fail with the error the namespace doesn;t match. This is the snippet of the code, i am using:

 var ProcessTestCase = new TestCase();

            //Create a validating read step
            //We should only have one file in the directory
            var validatingFileReadStep = new FileReadMultipleStep
               DirectoryPath = @"..\..\..\Tests\TestMessages\",
                ExpectedNumberOfFiles = 1,
                Timeout = 3000,
                DeleteFiles = false

            //Create an XML Validation step
            //This will check the result against the XSD for the document

            var validateInput = new XmlValidationStep();
            var inputSchemaType = new SchemaDefinition
                XmlSchemaPath = @"..\..\..\Projects\Request.xsd",
                XmlSchemaNameSpace = ""



            ProcessTestCase .ExecutionSteps.Add(validatingFileReadStep);
var bizUnit = new BizUnit.BizUnit(ProcessTestCase );
            var document = new XmlDocument();
The Content of my xml is:

 <Request xmlns=""></Request>

I have intentinally given the worng namespace in the xml. But the above test is getting passed without any error.


2) In Place of Request xml, if i give some other xml,in that case also same behaviour. test is getting passed.

Validation only works when i have xml tagname different in xml.


Please help me.



Deepak Sanghi