public static void ValidateDestinationMessage(string OutoutputMessageFolderPath, string outputFile, SchemaDefinition
                                                      destinationSchema, List <XPathDefinition> xpathList)
        {
            FileReadMultipleStep fileReadStep = new FileReadMultipleStep();

            fileReadStep.DeleteFiles           = false;
            fileReadStep.FailOnError           = true;
            fileReadStep.DirectoryPath         = OutoutputMessageFolderPath;
            fileReadStep.SearchPattern         = outputFile;
            fileReadStep.ExpectedNumberOfFiles = 1;


            XmlValidationStep validateOutPutStep = new XmlValidationStep();

            validateOutPutStep.XmlSchemas.Add(destinationSchema);

            foreach (var xpath in xpathList)
            {
                validateOutPutStep.XPathValidations.Add(xpath);
            }

            fileReadStep.SubSteps.Add(validateOutPutStep);

            TestCase outValTestCase = new TestCase();

            outValTestCase.Name = "Validate Output Message";
            outValTestCase.ExecutionSteps.Add(fileReadStep);

            BizUnit.Core.TestRunner testRunner = new BizUnit.Core.TestRunner(outValTestCase);
            testRunner.Run();
        }
Exemple #2
0
        public void ExecuteSendPipelineConfiguredDocSpecXmlAsmWithSimpleSchema()
        {
            // Create test case...
            var tc = new TestCase();

            tc.Name = "ExecuteSendPipelineConfiguredDocSpecXmlAsmWithSimpleSchema";

            var pipeStep = new ExecuteSendPipelineStep();

            pipeStep.PipelineAssemblyPath = @"..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Debug\BizUnit.BizTalkTestArtifacts.dll";
            pipeStep.PipelineTypeName     = "BizUnit.BizTalkTestArtifacts.SendPipeline2";
            var ds = new DocSpecDefinition
            {
                AssemblyPath =
                    @"..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Debug\BizUnit.BizTalkTestArtifacts.dll",
                TypeName = "BizUnit.BizTalkTestArtifacts.Schema2"
            };

            pipeStep.DocSpecs.Add(ds);
            pipeStep.SourceDir     = @"..\..\..\Test\BizUnit.BizTalkTestArtifacts\Instances\";
            pipeStep.SearchPattern = "Schema2.xml";
            pipeStep.Destination   = "Output.022.xml";
            // Add ExecuteReceivePipelineStep to test case
            tc.ExecutionSteps.Add(pipeStep);

            var exists = new ExistsStep();

            exists.DirectoryPath     = ".";
            exists.Timeout           = 2000;
            exists.SearchPattern     = "Output.022*.xml";
            exists.ExpectedNoOfFiles = 1;
            // Add ExistsStep to test case
            tc.ExecutionSteps.Add(exists);

            var fv = new FileReadMultipleStep();

            fv.DirectoryPath = ".";
            fv.SearchPattern = "Output.022.xml";
            fv.DeleteFiles   = false;

            var validation = new XmlValidationStep();
            var sd         = new SchemaDefinition();

            sd.XmlSchemaPath      = @"..\..\..\Test\BizUnit.BizTalkTestArtifacts\Schema2.xsd";
            sd.XmlSchemaNameSpace = "http://BizUnit.BizTalkTestArtifacts.Schema2";
            validation.XmlSchemas.Add(sd);
            // Add validation to FileReadMultipleStep
            fv.SubSteps.Add(validation);
            // Add FileReadMultipleStep to test case
            tc.ExecutionSteps.Add(exists);

            TestCase.SaveToFile(tc, "ExecuteSendPipelineConfiguredDocSpecXmlAsmWithSimpleSchema.xaml");

            // Execute test csse using serialised test case to test round tripping of serialisation...
            var bu = new BizUnit(TestCase.LoadFromFile("ExecuteSendPipelineConfiguredDocSpecXmlAsmWithSimpleSchema.xaml"));

            bu.RunTest();
        }
Exemple #3
0
        protected override void constructExecution(ref TestCase testCase)
        {
            delay();
            var fileRead = new FileReadMultipleStep()
            {
                DirectoryPath         = "c:\\hsdlfhsekrfzesfhfsdjfhdjkfshdkjfghsdkjf",
                Timeout               = 1000,
                NumberOfCharsToLog    = 0,
                SearchPattern         = "Test",
                ExpectedNumberOfFiles = 1
            };

            add(fileRead);
        }
Exemple #4
0
        public void CreateFileTest()
        {
            var step = new CreateStep
            {
                CreationPath = @"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\FileCreateStepTest.testdelxml"
            };
            var dl = new FileDataLoader
            {
                FilePath = @"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder001.xml"
            };

            step.DataSource = dl;
            step.Execute(new Context());

            var readStep = new FileReadMultipleStep
            {
                DirectoryPath = @"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\.",
                SearchPattern = "*.testdelxml"
            };

            var validation          = new XmlValidationStep();
            var schemaPurchaseOrder = new SchemaDefinition
            {
                XmlSchemaPath =
                    @"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestData\PurchaseOrder.xsd",
                XmlSchemaNameSpace =
                    "http://SendMail.PurchaseOrder"
            };

            validation.XmlSchemas.Add(schemaPurchaseOrder);

            var xpathProductId = new XPathDefinition
            {
                Description = "PONumber",
                XPath       =
                    "/*[local-name()='PurchaseOrder' and namespace-uri()='http://SendMail.PurchaseOrder']/*[local-name()='PONumber' and namespace-uri()='']",
                Value = "12323"
            };

            validation.XPathValidations.Add(xpathProductId);

            readStep.SubSteps.Add(validation);

            readStep.Execute(new Context());
        }
        public static void ValidateSouceMessage(string inputMessageFolderPath, string inputFile, SchemaDefinition sourceSchema)
        {
            FileReadMultipleStep fileReadStep = new FileReadMultipleStep();

            fileReadStep.DeleteFiles           = false;
            fileReadStep.DirectoryPath         = inputMessageFolderPath;
            fileReadStep.SearchPattern         = inputFile;
            fileReadStep.FailOnError           = true;
            fileReadStep.ExpectedNumberOfFiles = 1;

            XmlValidationStep inputValidationStep = new XmlValidationStep();

            inputValidationStep.XmlSchemas.Add(sourceSchema);

            fileReadStep.SubSteps.Add(inputValidationStep);
            TestCase inValTestCase = new TestCase();

            inValTestCase.Name = "Validate Input Message";
            inValTestCase.ExecutionSteps.Add(fileReadStep);

            BizUnit.Core.TestRunner testRunner = new BizUnit.Core.TestRunner(inValTestCase);
            testRunner.Run();
        }
Exemple #6
0
        public void CreateFileTest()
        {
            var step = new CreateStep();

            step.CreationPath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\FileCreateStepTest.testdelxml");
            var dl = new FileDataLoader();

            dl.FilePath     = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\PurchaseOrder001.xml");
            step.DataSource = dl;
            step.Execute(new Context());

            var readStep = new FileReadMultipleStep();

            readStep.DirectoryPath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"TestData\.");
            readStep.SearchPattern = "*.testdelxml";

            var validation          = new XmlValidationStep();
            var schemaPurchaseOrder = new SchemaDefinition
            {
                XmlSchemaPath =
                    Path.Combine(TestContext.CurrentContext.TestDirectory, @"..\..\TestData\PurchaseOrder.xsd"),
                XmlSchemaNameSpace = "http://SendMail.PurchaseOrder"
            };

            validation.XmlSchemas.Add(schemaPurchaseOrder);

            var xpathProductId = new XPathDefinition();

            xpathProductId.Description = "PONumber";
            xpathProductId.XPath       = "/*[local-name()='PurchaseOrder' and namespace-uri()='http://SendMail.PurchaseOrder']/*[local-name()='PONumber' and namespace-uri()='']";
            xpathProductId.Value       = "12323";
            validation.XPathValidations.Add(xpathProductId);

            readStep.SubSteps.Add(validation);

            readStep.Execute(new Context());
        }
        public void Upgrade_Eligible_Test_FILE()
        {
            var testCase = new TestCase();

            testCase.Name            = "Upgrade_Eligible_Test_FILE";
            testCase.Purpose         = "Test successful upgrade";
            testCase.Description     = "Test upgrade succeeds for passenger/flight eligible for upgrade";
            testCase.Category        = "BizUnit SDK: BVT";
            testCase.Reference       = "Use case: 10.3.4";
            testCase.ExpectedResults = "Upgrade succeeds";
            testCase.Preconditions   = "Solution should be deployed, bound and started";

            // First ensure the target directory is empty...
            var delFiles = new DeleteStep();

            delFiles.FilePathsToDelete = new Collection <string> {
                @"C:\Temp\BizTalk\BizUnitSdkOut\*.xml"
            };
            testCase.SetupSteps.Add(delFiles);

            // Then execute the main scenario.
            var testStep = new CreateStep();

            // Where are we going to create the file.
            testStep.CreationPath = @"C:\Temp\BizTalk\BizUnitSdkIn\Request.xml";
            var dataLoader = new FileDataLoader();

            // Where are we getting the original file from?
            dataLoader.FilePath = @"..\..\Data\Request.xml";
            testStep.DataSource = dataLoader;

            testCase.ExecutionSteps.Add(testStep);

            // Add validation....
            var validation       = new XmlValidationStep();
            var schemaResultType = new SchemaDefinition
            {
                XmlSchemaPath      = @"..\..\..\..\Src\FlightUpgrade\ResponseMsg.xsd",
                XmlSchemaNameSpace = "http://bizUnit.sdk.flightUpgrade/upgradeResponse"
            };

            validation.XmlSchemas.Add(schemaResultType);

            var responseXpath = new XPathDefinition();

            responseXpath.Description = "GetProducts_RS/Result/result";
            responseXpath.XPath       = "/*[local-name()='UpgradeResponse' and namespace-uri()='http://bizUnit.sdk.flightUpgrade/upgradeResponse']/*[local-name()='UpgradeResult' and namespace-uri()='']/*[local-name()='Result' and namespace-uri()='']";
            responseXpath.Value       = "true";
            validation.XPathValidations.Add(responseXpath);

            // Check that an output file has been created.
            var finalFileReadStep = new FileReadMultipleStep();

            finalFileReadStep.DirectoryPath         = @"C:\Temp\BizTalk\BizUnitSdkOut";
            finalFileReadStep.SearchPattern         = "*.xml";
            finalFileReadStep.ExpectedNumberOfFiles = 1;
            finalFileReadStep.Timeout     = 5000;
            finalFileReadStep.DeleteFiles = false;

            finalFileReadStep.SubSteps.Add(validation);
            testCase.ExecutionSteps.Add(finalFileReadStep);

            var bizUnit = new BizUnit(testCase);

            bizUnit.RunTest();
            TestCase.SaveToFile(testCase, System.String.Format("Upgrade_Eligible_Test_File_{0}.xml", System.String.Format("{0:yyyy-MM-dd-hh_mm_ss}", System.DateTime.Now)));
        }
        public void Upgrade_Elligable_Test()
        {
            var testCase = new TestCase();

            testCase.Name            = "Upgrade_Elligable_Test";
            testCase.Purpose         = "Test successful upgrade";
            testCase.Description     = "Test upgrade succeeds for passenger/flight not elligable for upgrade";
            testCase.Category        = "BizUnit SDK: BVT";
            testCase.Reference       = "Use case: 10.3.4";
            testCase.ExpectedResults = "Upgrade succeeds";
            testCase.Preconditions   = "Solution should be deployed, bound and started";

            // First ensure the target directory is empty...
            var delFiles = new DeleteStep();

            delFiles.FilePathsToDelete = new Collection <string> {
                @"C:\Temp\BizTalk\BizUnitSdkOut\*.xml"
            };
            testCase.SetupSteps.Add(delFiles);

            // Then execute the main scenario, execute a response-response web set step which is executed concurrently.
            // i.e. whilst this step is waiting for the response the next step, FileReadMultipleStep and then CreateStep
            // will be executed.
            var wsStep = new WebServiceStep();

            wsStep.Action      = "Upgrade";
            wsStep.ServiceUrl  = "http://localhost/BizUnit.Sdk.FlightUpgrade/BizUnit_Sdk_FlightUpgrade_ProcessRequest_UpgradePort.svc";
            wsStep.RequestBody = new FileDataLoader {
                FilePath = @"..\..\..\Tests\FlightUpgrade.Tests\Data\Request.xml"
            };
            wsStep.RunConcurrently = true;

            // Add validation....
            var validation       = new XmlValidationStep();
            var schemaResultType = new SchemaDefinition
            {
                XmlSchemaPath      = @"..\..\..\Src\FlightUpgrade\ResponseMsg.xsd",
                XmlSchemaNameSpace = "http://bizUnit.sdk.flightUpgrade/upgradeResponse"
            };

            validation.XmlSchemas.Add(schemaResultType);

            var responseXpath = new XPathDefinition();

            responseXpath.Description = "GetProducts_RS/Result/result";
            responseXpath.XPath       = "/*[local-name()='UpgradeResponse' and namespace-uri()='http://bizUnit.sdk.flightUpgrade/upgradeResponse']/*[local-name()='UpgradeResult' and namespace-uri()='']/*[local-name()='Result' and namespace-uri()='']";
            responseXpath.Value       = "true";
            validation.XPathValidations.Add(responseXpath);

            var fileReadStep = new FileReadMultipleStep();

            fileReadStep.DirectoryPath         = @"C:\Temp\BizTalk\BizUnitSdkOut";
            fileReadStep.SearchPattern         = "*.xml";
            fileReadStep.ExpectedNumberOfFiles = 1;
            fileReadStep.Timeout     = 5000;
            fileReadStep.DeleteFiles = true;

            var createFileStep = new CreateStep();

            createFileStep.CreationPath = @"..\..\..\Data\In\UpgradeResponse.xml";
            createFileStep.DataSource   = new FileDataLoader {
                FilePath = @"..\..\..\Tests\FlightUpgrade.Tests\Data\Response.xml"
            };

            testCase.ExecutionSteps.Add(wsStep);
            testCase.ExecutionSteps.Add(fileReadStep);
            testCase.ExecutionSteps.Add(createFileStep);

            var bizUnit = new BizUnit(testCase);

            bizUnit.RunTest();
            TestCase.SaveToFile(testCase, "Upgrade_Elligable_Test.xml");
        }
        public void ImportSingleTestCaseTest()
        {
            TestHelper.DeleteFile("ImportSingleTestCaseTest.xml");

            // Create the first test case i a helper method...
            var testCase1 = BuildFirstTestCase();

            // Create the second test case and import the first test case into it...
            var testCase2 = new TestCase {
                Name = "Copy First File Test"
            };

            var createFileStep = new CreateStep {
                CreationPath = @"File2.xml"
            };
            var dl = new FileDataLoader
            {
                FilePath = @"..\..\TestData\PurchaseOrder001.xml"
            };

            createFileStep.DataSource = dl;

            testCase2.ExecutionSteps.Add(createFileStep);

            var import = new ImportTestCaseStep {
                TestCase = testCase1
            };

            testCase2.ExecutionSteps.Add(import);

            // Create a validating read step...
            var validatingFileReadStep = new FileReadMultipleStep
            {
                DirectoryPath         = @".",
                SearchPattern         = "File*.xml",
                ExpectedNumberOfFiles = 2
            };

            var validation          = new XmlValidationStep();
            var schemaPurchaseOrder = new SchemaDefinition
            {
                XmlSchemaPath =
                    @"..\..\TestData\PurchaseOrder.xsd",
                XmlSchemaNameSpace =
                    "http://SendMail.PurchaseOrder"
            };

            validation.XmlSchemas.Add(schemaPurchaseOrder);

            var xpathProductId = new XPathDefinition
            {
                Description = "PONumber",
                XPath       =
                    "/*[local-name()='PurchaseOrder' and namespace-uri()='http://SendMail.PurchaseOrder']/*[local-name()='PONumber' and namespace-uri()='']",
                Value = "12323"
            };

            validation.XPathValidations.Add(xpathProductId);
            validatingFileReadStep.SubSteps.Add(validation);
            testCase2.ExecutionSteps.Add(validatingFileReadStep);

            // Run the second test case...
            var bizUnit = new BizUnit(testCase2);

            bizUnit.RunTest();

            TestCase.SaveToFile(testCase2, "ImportSingleTestCaseTest.xml");
        }
        public void Integration_Test()
        {
            #region Variable Intialization
            var sourceFilePath        = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\Testing\OrderSample.xml";
            var targetFilePath        = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\Testing\Order\OrderSample.xml";
            var DestinationDirSummary = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\Testing\Summary";
            #endregion

            #region Initial CleanUp Step
            //Get rid of any files that are already there
            var deleteStep = new DeleteStep();
            deleteStep.FilePathsToDelete.Add(targetFilePath);
            #endregion

            #region Create step
            //Create the test step
            var createStep = new CreateStep();
            createStep.CreationPath = targetFilePath;   //Where are we going to create the file
            var dataLoader = new FileDataLoader();      //Where are we getting the file from?
            dataLoader.FilePath   = sourceFilePath;
            createStep.DataSource = dataLoader;
            #endregion

            #region Execution steps

            #region File Validation Step
            //Create a validating read step //We should only have one file in the directory
            var ValidateFileStep = new FileReadMultipleStep();
            ValidateFileStep.DirectoryPath         = DestinationDirSummary;
            ValidateFileStep.SearchPattern         = "*.xml";
            ValidateFileStep.Timeout               = 60000;
            ValidateFileStep.ExpectedNumberOfFiles = 1;
            ValidateFileStep.DeleteFiles           = true;
            #endregion

            #region  #SubSteps - Schema and node value Validation Step
            //Create an XML Validation step //This will check the result against the XSD for the document
            var summarySchemaValidationStep = new XmlValidationStep();
            var schemaSummary = new SchemaDefinition();
            schemaSummary.XmlSchemaPath      = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\Timewave.BizUnit.Sample\Timewave.BizUnit.Sample\Schemas\SummarySchema.xsd";
            schemaSummary.XmlSchemaNameSpace = "http://Timewave.BizTalkUnit.Sample.DestinationSchema";

            summarySchemaValidationStep.XmlSchemas.Add(schemaSummary);

            //Create an XPath Validation.  This will check a value in the output.
            //The Xpath for the node can be grabbed from the Instance XPath property on the XSD.
            var xpathProductId = new XPathDefinition();
            xpathProductId.Description = "ItemsOrdered";
            xpathProductId.XPath       = "/*[local-name()='CustomerSummary' and namespace-uri()='http://Timewave.BizTalkUnit.Sample.DestinationSchema']/*[local-name()='ItemsOrdered' and namespace-uri()='']";
            xpathProductId.Value       = "1";
            summarySchemaValidationStep.XPathValidations.Add(xpathProductId);

            ValidateFileStep.SubSteps.Add(summarySchemaValidationStep);

            #endregion

            #endregion

            #region Test Case Execution
            var testCase = new TestCase();
            testCase.SetupSteps.Add(deleteStep);
            testCase.ExecutionSteps.Add(createStep);
            testCase.ExecutionSteps.Add(ValidateFileStep);
            testCase.CleanupSteps.Add(deleteStep);

            var testRunner = new TestRunner(testCase);
            testRunner.Run();


            #endregion
        }
        public void ExecuteSendPipelineWithDefaultXmlAsmWithImportedSchemaTest()
        {
            // Create test case...
            var tc = new TestCase {
                Name = "ExecuteSendPipelineWithDefaultXmlAsmWithImportedSchemaTest"
            };

            var pipeStep = new ExecuteSendPipelineStep
            {
                PipelineAssemblyPath =
                    @"..\..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Debug\BizUnit.BizTalkTestArtifacts.dll",
                PipelineTypeName = "BizUnit.BizTalkTestArtifacts.SendPipeline1"
            };
            var ds = new DocSpecDefinition
            {
                AssemblyPath =
                    @"..\..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Debug\BizUnit.BizTalkTestArtifacts.dll",
                TypeName = "BizUnit.BizTalkTestArtifacts.Schema0"
            };

            pipeStep.DocSpecs.Add(ds);
            ds = new DocSpecDefinition
            {
                AssemblyPath =
                    @"..\..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Debug\BizUnit.BizTalkTestArtifacts.dll",
                TypeName = "BizUnit.BizTalkTestArtifacts.Schema3Env"
            };
            pipeStep.DocSpecs.Add(ds);
            pipeStep.SourceDir     = @"..\..\..\..\Test\BizUnit.BizTalkTestArtifacts\Instances\";
            pipeStep.SearchPattern = "Child*.xml";
            pipeStep.Destination   = "Output.021.xml";
            // Add ExecuteReceivePipelineStep to test case
            tc.ExecutionSteps.Add(pipeStep);

            var exists = new ExistsStep
            {
                DirectoryPath     = ".",
                Timeout           = 2000,
                SearchPattern     = "Output.021*.xml",
                ExpectedNoOfFiles = 1
            };

            // Add ExistsStep to test case
            tc.ExecutionSteps.Add(exists);

            var fv = new FileReadMultipleStep
            {
                DirectoryPath = ".",
                SearchPattern = "Output.021.xml",
                DeleteFiles   = false
            };

            var validation = new XmlValidationStep();
            var sd         = new SchemaDefinition
            {
                XmlSchemaPath      = @"..\..\..\..\Test\BizUnit.BizTalkTestArtifacts\Schema0.xsd",
                XmlSchemaNameSpace = "http://BizUnit.BizTalkTestArtifacts.Schema0"
            };

            validation.XmlSchemas.Add(sd);
            sd = new SchemaDefinition
            {
                XmlSchemaPath      = @"..\..\..\..\Test\BizUnit.BizTalkTestArtifacts\Schema3Env.xsd",
                XmlSchemaNameSpace = "http://BizUnit.BizTalkTestArtifacts.Schema3Env"
            };
            validation.XmlSchemas.Add(sd);
            // Add validation to FileReadMultipleStep
            fv.SubSteps.Add(validation);
            // Add FileReadMultipleStep to test case
            tc.ExecutionSteps.Add(exists);

            TestCase.SaveToFile(tc, "ExecuteSendPipelineWithDefaultXmlAsmWithImportedSchemaTest.xaml");

            // Execute test csse using serialised test case to test round tripping of serialisation...
            var bu =
                new BizUnit(TestCase.LoadFromFile("ExecuteSendPipelineWithDefaultXmlAsmWithImportedSchemaTest.xaml"));

            bu.RunTest();
        }
Exemple #12
0
        public void SummaryTest()
        {
            //var totalItemsTest = new TestCase { Name = "Total Items is 3" };


            var sourceFilePath = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\Testing\OrderSample.xml";
            //var targetDirectory = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\Testing\Order";
            var targetFilePath        = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\Testing\Order\OrderSample.xml";
            var DestinationDirSummary = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\Testing\Summary";


            //Get rid of any files that are already there
            var deleteStep = new DeleteStep();

            deleteStep.FilePathsToDelete.Add(targetFilePath);

            //Create the test step
            var createStep = new CreateStep();

            createStep.CreationPath = targetFilePath;   //Where are we going to create the file
            var dataLoader = new FileDataLoader();      //Where are we getting the file from?

            dataLoader.FilePath   = sourceFilePath;
            createStep.DataSource = dataLoader;

            //Create a validating read step //We should only have one file in the directory
            var ValidateFileStep = new FileReadMultipleStep();

            ValidateFileStep.DirectoryPath         = DestinationDirSummary;
            ValidateFileStep.SearchPattern         = "*.xml";
            ValidateFileStep.Timeout               = 3000;
            ValidateFileStep.ExpectedNumberOfFiles = 1;
            ValidateFileStep.DeleteFiles           = true;


            //Create an XML Validation step //This will check the result against the XSD for the document
            var summarySchemaValidationStep = new XmlValidationStep();
            var schemaSummary = new SchemaDefinition();

            schemaSummary.XmlSchemaPath      = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\Timewave.BizUnit.Sample\Timewave.BizUnit.Sample\Schemas\SummarySchema.xsd";
            schemaSummary.XmlSchemaNameSpace = "http://Timewave.BizTalkUnit.Sample.DestinationSchema";

            summarySchemaValidationStep.XmlSchemas.Add(schemaSummary);

            //Create an XPath Validation.  This will check a value in the output.
            //The Xpath for the node can be grabbed from the Instance XPath property on the XSD.
            var xpathProductId = new XPathDefinition();

            xpathProductId.Description = "ItemsOrdered";
            xpathProductId.XPath       = "/*[local-name()='CustomerSummary' and namespace-uri()='http://Timewave.BizTalkUnit.Sample.DestinationSchema']/*[local-name()='ItemsOrdered' and namespace-uri()='']";
            xpathProductId.Value       = "2";
            summarySchemaValidationStep.XPathValidations.Add(xpathProductId);

            ValidateFileStep.SubSteps.Add(summarySchemaValidationStep);

            var testCase = new TestCase();

            testCase.SetupSteps.Add(deleteStep);
            testCase.ExecutionSteps.Add(createStep);
            testCase.ExecutionSteps.Add(ValidateFileStep);
            testCase.CleanupSteps.Add(deleteStep);

            var testRunner = new TestRunner(testCase);

            try
            {
                testRunner.Run();
            }
            catch (Exception ex)
            {
                string filePath = @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\TestResult\Error.txt";

                using (StreamWriter writer = new StreamWriter(filePath, true))
                {
                    writer.WriteLine("-----------------------------------------------------------------------------");
                    writer.WriteLine("Date : " + DateTime.Now.ToString());
                    writer.WriteLine();

                    while (ex != null)
                    {
                        writer.WriteLine(ex.GetType().FullName);
                        writer.WriteLine("Message : " + ex.Message);
                        writer.WriteLine("StackTrace : " + ex.StackTrace);

                        ex = ex.InnerException;
                    }
                }
            }
            finally
            {
                TestCase.SaveToFile(
                    testCase,
                    @"C:\Users\amigupta7\Desktop\Amit\Project\POC\Timewave.BizUnit.Sample\TestResult\SampleTest.xaml",
                    true);
            }
        }