public void Test_07_StringFormatterMultipleStep() { //set up the required steps StringFormatterMultipleStep sfStep = new StringFormatterMultipleStep(); sfStep.BaseString = "exec NotifyNewCRM '{0}','1'"; string[] tokens = new string[1]; tokens[0] = "101000215026"; sfStep.Tokens = tokens; sfStep.ContextKeyWithResult = "OutputString"; //Now instantiate the test case container TestCase tc = new TestCase(); tc.Name = "Test_07_StringFormatterMultipleStep"; //Add the test steps into the container at the required stages tc.ExecutionSteps.Add(sfStep); //Initialise BizUnit runner with the test case container BizUnit bizUnit = new BizUnit(tc); //run the test bizUnit.RunTest(); Assert.AreEqual("exec NotifyNewCRM '101000215026','1'", bizUnit.Ctx.GetValue("OutputString")); }
public void DelayTestCaseTest() { DeleteFiles(); int stepDelayDuration = 500; var step = new DelayStep(); step.DelayMilliSeconds = stepDelayDuration; var sw = new Stopwatch(); sw.Start(); step.Execute(new Context()); var actualDuration = sw.ElapsedMilliseconds; Console.WriteLine("Observed delay: {0}", actualDuration); Assert.AreEqual(stepDelayDuration, actualDuration, 20); stepDelayDuration = 5; step.DelayMilliSeconds = stepDelayDuration; var tc = new TestCase(); tc.ExecutionSteps.Add(step); TestCase.SaveToFile(tc, "DelayTestCaseTest.xaml"); var bu = new BizUnit(TestCase.LoadFromFile("DelayTestCaseTest.xaml")); sw = new Stopwatch(); sw.Start(); bu.RunTest(); actualDuration = sw.ElapsedMilliseconds; Console.WriteLine("Observed delay: {0}", actualDuration); Assert.AreEqual(actualDuration, stepDelayDuration, 20); }
public void Test_11_RestHttpRequestResponseStepEx_DEL() { //setup the required steps RestHttpRequestResponseStepEx soapStep = new RestHttpRequestResponseStepEx(); soapStep.Url = "http://localhost//resttestwebservice/api/books/1"; soapStep.Method = "DELETE"; soapStep.ContentType = "application/xml"; soapStep.InputFile = @".\..\..\TestData\GetBooks.json"; soapStep.OutputFile = @".\..\..\TestData\out\DelBooksResponse.xml"; //Now instantiate the test case container TestCase tc = new TestCase(); tc.Name = "Test_11_RestHttpRequestResponseStepEx_DEL"; //Add the test steps into the container at the required stages tc.ExecutionSteps.Add(soapStep); //Initialise BizUnit runner with the test case container BizUnit bizUnit = new BizUnit(tc); //run the test bizUnit.RunTest(); Assert.IsTrue(File.Exists(@".\..\..\TestData\out\DelBooksResponse.xml"), "DELETE failed! See Output log."); File.Delete(@".\..\..\TestData\out\DelBooksResponse.xml"); }
public void Test_10_SoapHttpRequestResponseStepEx() { //setup the required steps SoapHttpRequestResponseStepEx soapStep = new SoapHttpRequestResponseStepEx(); soapStep.Url = "http://localhost/POWebService/SubmitPOService.asmx"; soapStep.SoapAction = "http://Microsoft.Samples.BizTalk.ConsumeWebService/webservices/submitPO"; soapStep.InputFile = @".\..\..\TestData\PORequest.xml"; soapStep.OutputFile = @".\..\..\TestData\out\POResponse.xml"; //Now instantiate the test case container TestCase tc = new TestCase(); tc.Name = "Test_10_SoapHttpRequestResponseStepEx"; //Add the test steps into the container at the required stages tc.ExecutionSteps.Add(soapStep); //Initialise BizUnit runner with the test case container BizUnit bizUnit = new BizUnit(tc); //run the test bizUnit.RunTest(); XmlDocument xDoc = new XmlDocument(); xDoc.Load(@".\..\..\TestData\out\POResponse.xml"); XmlNode testNode = xDoc.SelectSingleNode("/*[local-name()='submitPOResponse']/*[local-name()='submitPOResult' ]/*[local-name()='InvoiceNumber' ]"); string actualValue = testNode.InnerText; //Do an assertion on the XpAth value Assert.AreEqual("string", actualValue); //now delete the file File.Delete(@".\..\..\TestData\out\POResponse.xml"); }
public void Create_FileCreateStep_TakeFromCtx() { Context ctx = new Context(); ctx.Add("PathToWriteFileTo", @"..\..\..\Test\BizUnit.Tests\Out\Data_%Guid%.xml"); TestStepBuilder tsb = new TestStepBuilder("BizUnit.FileCreateStep", null); object[] args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Data\LoadGenScript001.xml"; tsb.SetProperty("SourcePath", args); args = new object[1]; args[0] = "takeFromCtx:PathToWriteFileTo"; tsb.SetProperty("CreationPath", args); string testDirectory = @"..\..\..\Test\BizUnit.Tests\Out"; FileHelper.EmptyDirectory(testDirectory, "*.xml"); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); BizUnitTestCase testCase = new BizUnitTestCase("Create_FileCreateStep_TakeFromCtx"); // Add the test step builder to the test case... testCase.AddTestStep(tsb, TestStage.Execution); BizUnit bizUnit = new BizUnit(testCase, ctx); bizUnit.RunTest(); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 1); }
public void Create_FileCreateStep_AndSetSimpleTypes() { TestStepBuilder tsb = new TestStepBuilder("BizUnit.FileCreateStep", null); object[] args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Data\LoadGenScript001.xml"; tsb.SetProperty("SourcePath", args); args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Out\Data_%Guid%.xml"; tsb.SetProperty("CreationPath", args); string testDirectory = @"..\..\..\Test\BizUnit.Tests\Out"; FileHelper.EmptyDirectory(testDirectory, "*.xml"); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); BizUnitTestCase testCase = new BizUnitTestCase("Create_FileCreateStep_AndSetSimpleTypes"); // Add the test step builder to the test case... testCase.AddTestStep(tsb, TestStage.Execution); BizUnit bizUnit = new BizUnit(testCase); bizUnit.RunTest(); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 1); }
public void CreateLocation() { TestCase btc = new TestCase(); string address = Path.GetTempPath(); ReceiveLocationCreateStep createStep = new ReceiveLocationCreateStep { PortName = "BizUnitTestPort", LocationName = "BizUnitTestLocation", Address = address, Pipeline = ReceiveLocationCreateStep.PipelineType.Xml }; btc.ExecutionSteps.Add(createStep); DelayStep delayStep = new DelayStep { DelayMilliSeconds = 60000 }; btc.ExecutionSteps.Add(delayStep); ReceiveLocationEnabledStep validateStep = new ReceiveLocationEnabledStep { ReceiveLocationName = "BizUnitTestLocation", IsDisabled = true }; btc.ExecutionSteps.Add(validateStep); ReceivePortConductorStep enableStep = new ReceivePortConductorStep { ReceivePortName = "BizUnitTestPort", ReceiveLocationName = "BizUnitTestLocation", Action = ReceivePortConductorStep.ReceivePortAction.Enable }; btc.ExecutionSteps.Add(enableStep); ReceivePortConductorStep disableStep = new ReceivePortConductorStep { ReceivePortName = "BizUnitTestPort", ReceiveLocationName = "BizUnitTestLocation", Action = ReceivePortConductorStep.ReceivePortAction.Disable }; btc.CleanupSteps.Add(disableStep); ReceiveLocationDeleteStep deleteStep = new ReceiveLocationDeleteStep { LocationName = "BizUnitTestLocation" }; btc.CleanupSteps.Add(deleteStep); BizUnit bu = new BizUnit(btc); bu.RunTest(); }
public void Test_04_FileDeleteEx() { // First we create two sample files to be deleted string path = @".\..\..\TestData\BizUnitTestFile.txt"; string path2 = @".\..\..\TestData\BizUnitTestFile2.txt"; TextWriter ts = File.CreateText(path); ts.WriteLine("This file is used to test the BizUnit fileDeleteExStep."); ts.Close(); ts = File.CreateText(path2); ts.WriteLine("This file is also used to test the BiUnit FileDeleteExStep."); ts.Close(); //Now we setup the BizUnit steps FileDeleteExStep fdStep = new FileDeleteExStep(); //put the files to delete into a list and pass it to the step List <string> files = new List <string>(); files.Add(path); files.Add(path2); fdStep.FilesToDelete = files; //Now instantiate the test case container TestCase tc = new TestCase(); tc.Name = "Test_04_FileDeleteEx"; //Add the test steps into the container at the required stages tc.ExecutionSteps.Add(fdStep); //Initialise BizUnit runner with the test case container BizUnit bizUnit = new BizUnit(tc); //run the test bizUnit.RunTest(); }
public void FileCreateStepTest_Negative() { string testDirectory = @"..\..\..\Test\BizUnit.Tests\Out"; FileHelper.EmptyDirectory(testDirectory, "*.xml"); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); BizUnitTestCase testCase = new BizUnitTestCase("FileCreateStepTest_Negative"); FileCreateStep fcs = new FileCreateStep(); fcs.SourcePath = @"C:\GarbageDirectory__NoOneWouldHaveADirCalledThisSurely\LoadGenScript001.xml"; fcs.CreationPath = testDirectory + @"\Data_%Guid%.xml"; testCase.AddTestStep(fcs, TestStage.Execution); BizUnit bizUnit = new BizUnit(testCase); bool exceptionCaught = false; try { bizUnit.RunTest(); } catch (DirectoryNotFoundException) { exceptionCaught = true; } Assert.IsTrue(exceptionCaught); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); }
public void CheckEventLogEntry() { TestStepBuilder tsb = new TestStepBuilder("BizUnit.EventLogCheckStep", null); object[] args = new object[1]; args[0] = "Application"; tsb.SetProperty("EventLog", args); args = new object[1]; args[0] = "VAA FFP"; tsb.SetProperty("Source", args); args = new object[1]; args[0] = "Error"; tsb.SetProperty("EventType", args); args = new object[1]; args[0] = 2028; tsb.SetProperty("EventId", args); args = new object[1]; args[0] = "FieldValue: '3'"; tsb.SetProperty("ValidationRegexs", args); BizUnitTestCase testCase = new BizUnitTestCase("FileCreateStepTest"); testCase.AddTestStep(tsb, TestStage.Execution); BizUnit bizUnit = new BizUnit(testCase); bizUnit.RunTest(); }
public void FileCreateStep_FileDeleteMultipleStepTest() { string testDirectory = @"..\..\..\Test\BizUnit.Tests\Out"; FileHelper.EmptyDirectory(testDirectory, "*.xml"); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); BizUnitTestCase testCase = new BizUnitTestCase("FileCreateStep_FileDeleteMultipleStepTest"); FileCreateStep fcs = new FileCreateStep(); fcs.SourcePath = @"..\..\..\Test\BizUnit.Tests\Data\LoadGenScript001.xml"; fcs.CreationPath = testDirectory + @"\Data_%Guid%.xml"; testCase.AddTestStep(fcs, TestStage.Execution); FileDeleteMultipleStep fds = new FileDeleteMultipleStep(); fds.Directory = testDirectory; fds.SearchPattern = "*.xml"; testCase.AddTestStep(fds, TestStage.Execution); BizUnit bizUnit = new BizUnit(testCase); bizUnit.RunTest(); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); }
public void ObjectModelMixedWithConfigTest() { string config = ResourceLoaderHelper.GetResourceData("Data", "FileMoveConfig.xml"); string testDirectory = @"..\..\..\Test\BizUnit.Tests\Out"; FileHelper.EmptyDirectory(testDirectory, "*.xml"); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); BizUnitTestCase testCase = new BizUnitTestCase("ObjectModelMixedWithConfigTest"); // Add an object model defined BizUnit step... FileCreateStep fcs = new FileCreateStep(); fcs.SourcePath = @"..\..\..\Test\BizUnit.Tests\Data\LoadGenScript001.xml"; fcs.CreationPath = testDirectory + @"\InDoc1.xml"; testCase.AddTestStep(fcs, TestStage.Execution); // Add a config defined BizUnit step... FileMoveStep fms = new FileMoveStep(); testCase.AddTestStep(fms, config, TestStage.Execution); BizUnit bizUnit = new BizUnit(testCase); bizUnit.RunTest(); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 1); }
public void FileCreateStepTest_Negative() { string testDirectory = @"..\..\..\Test\BizUnit.Tests\Out"; FileHelper.EmptyDirectory(testDirectory, "*.xml"); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); BizUnitTestCase testCase = new BizUnitTestCase("FileCreateStepTest_Negative"); FileCreateStep fcs = new FileCreateStep(); fcs.SourcePath = @"C:\GarbageDirectory__NoOneWouldHaveADirCalledThisSurely\LoadGenScript001.xml"; fcs.CreationPath = testDirectory + @"\Data_%Guid%.xml"; testCase.AddTestStep(fcs, TestStage.Execution); BizUnit bizUnit = new BizUnit(testCase); bool exceptionCaught = false; try { bizUnit.RunTest(); } catch(DirectoryNotFoundException) { exceptionCaught = true; } Assert.IsTrue(exceptionCaught); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); }
public void Test_06_StringFormatterStep() { //Setup the required step StringFormatterStep sfStep = new StringFormatterStep(); sfStep.BaseString = "Update table set fld = '{0}' where fld1 = '{1}'"; sfStep.Delimiter = "|"; sfStep.NumParams = 2; sfStep.ParamString = "Smith|10192929239"; sfStep.ContextKeyWithResult = "OutputString"; //Now instantiate the test case container TestCase tc = new TestCase(); tc.Name = "Test_06_StringFormatterStep"; //Add the test steps into the container at the required stages tc.ExecutionSteps.Add(sfStep); //Initialise BizUnit runner with the test case container BizUnit bizUnit = new BizUnit(tc); //run the test bizUnit.RunTest(); Assert.AreEqual("Update table set fld = 'Smith' where fld1 = '10192929239'", bizUnit.Ctx.GetValue("OutputString")); }
public void TestMultiple() { OleDbQuerySequenceStep step = new OleDbQuerySequenceStep { ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=10.0.0.233;User Id=vanhos2;Password=vanhos2;Initial Catalog=db11g", SQLQuerySequence = new OleDbQuery[] { new OleDbQuery { RawSqlQuery = "SELECT * FROM TESTING", NumberOfRowsExpected = 1 }, new OleDbQuery { RawSqlQuery = "SELECT COUNT(*) AS cnt FROM TESTING", NumberOfRowsExpected = 1 } } }; TestCase btc = new TestCase(); btc.ExecutionSteps.Add(step); BizUnit bu = new BizUnit(btc); bu.RunTest(); }
public void Test_05_WaitOnFileEx() { //setup the required steps WaitOnFileExStep wStep = new WaitOnFileExStep(); wStep.Path = @".\..\..\TestData\out\"; wStep.FileFilter = "*.xml"; wStep.TimeOut = 5000; wStep.IncludeOldFiles = "Y"; //Now instantiate the test case container TestCase tc = new TestCase(); tc.Name = "Test_05_WaitOnFileEx"; //Add the test steps into the container at the required stages tc.ExecutionSteps.Add(wStep); //Initialise BizUnit runner with the test case container BizUnit bizUnit = new BizUnit(tc); //run the test bizUnit.RunTest(); Assert.AreEqual("file.xml", bizUnit.Ctx.GetValue("DetectedFileName")); }
public void PostToSharepoint() { TestCase btc = new TestCase() { Name = "Post a document to sharepoint", Description = "Check/Validate the Sharepoint steps", BizUnitVersion = "4.0.0.1" }; var docToSharepoint = new PostDocumentToSharepointStep() { DocumentToUploadPath = "../../../../BizUnit4.0_Src/Test/BizUnit.TestSteps.i8c.Tests/TestData/Personeel_small.xlsx", DocumentName = "Personeel small", SharePointSite = @"http://SHP-2010001:99/sites/BizTalk", DocumentLibraryName = "BizTalk Document Library", ColumnParameters = new Dictionary <string, string> { { "Processing_x0020_State", "1" }, { "Validation_x0020_State", "1" } } }; btc.ExecutionSteps.Add(docToSharepoint); BizUnit bu = new BizUnit(btc); TestCase.SaveToFile(btc, "DocumentToSharepoint.xaml"); bu.RunTest(); }
public void WebServiceInvoke_LoadFromXaml() { var tc = TestCase.LoadFromFile(@"..\..\..\..\Test\BizUnit.TestSteps.Tests\TestCases\WebServiceInvokeTest.xml"); var bu = new BizUnit(tc); bu.RunTest(); }
public void TestCaseValidationTest() { var step = new CreateStep(); var tc = new TestCase(); tc.ExecutionSteps.Add(step); var bu = new BizUnit(tc); bu.RunTest(); }
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(); }
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 Test_09_XmlValidateFail() { // Create the test case var testCase = TestCase.LoadFromFile(@".\..\..\TestCases\Test_09_XmlValidate_Fail.xml"); // Execute the test var bizUnit = new BizUnit(testCase); bizUnit.RunTest(); }
public void Create_FileDeleteStep_AndSetstringArray() { BizUnitTestCase testCase = new BizUnitTestCase("Create_FileDeleteStep_AndSetstringArray"); // Create a file in the output dir... TestStepBuilder tsb1 = new TestStepBuilder("BizUnit.FileCreateStep", null); object[] args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Data\LoadGenScript001.xml"; tsb1.SetProperty("SourcePath", args); args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Out\Data_File1.xml"; tsb1.SetProperty("CreationPath", args); // Add the test step builder to the test case... testCase.AddTestStep(tsb1, TestStage.Execution); // Create a file in the output dir... TestStepBuilder tsb2 = new TestStepBuilder("BizUnit.FileCreateStep", null); args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Data\LoadGenScript001.xml"; tsb2.SetProperty("SourcePath", args); args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Out\Data_File2.xml"; tsb2.SetProperty("CreationPath", args); // Add the test step builder to the test case... testCase.AddTestStep(tsb2, TestStage.Execution); TestStepBuilder tsb3 = new TestStepBuilder("BizUnit.FileDeleteStep", null); args = new object[2]; args[0] = @"..\..\..\Test\BizUnit.Tests\Out\Data_File1.xml"; args[1] = @"..\..\..\Test\BizUnit.Tests\Out\Data_File2.xml"; tsb3.SetProperty("FilesToDeletePath", args); string testDirectory = @"..\..\..\Test\BizUnit.Tests\Out"; // Add the test step builder to the test case... testCase.AddTestStep(tsb3, TestStage.Execution); FileHelper.EmptyDirectory(testDirectory, "*.xml"); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); BizUnit bizUnit = new BizUnit(testCase); bizUnit.RunTest(); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); }
public void EventTest() { Console.WriteLine(Environment.CurrentDirectory); BizUnit bizUnit = new BizUnit(@"..\..\..\Test\BizUnit.Tests\Data\BizUnitEventTest001.xml"); bizUnit.TestStepStartEvent += TestStepStart; bizUnit.TestStepStartEvent += TestStepStart; bizUnit.TestStepStopEvent += TestStepStop; bizUnit.RunTest(); }
public void ExecuteTestCase() { var btc = new TestCase(); btc.Name = "Serialization Test"; btc.Description = "Test to blah blah blah, yeah really!"; btc.BizUnitVersion = "4.0.0.1"; var fm = new DelayStep {DelayMilliSeconds = 35}; btc.SetupSteps.Add(fm); var bu = new BizUnit(btc); bu.RunTest(); }
// TODO: Test case is missing for some reason... // [TestMethod] public void FactStuff() { Object[] factObjArray = null; // Initialize facts... Context ctx = new Context(); ctx.Add("Fact1", 32); ctx.Add("Fact2", factObjArray); BizUnit bizUnit = new BizUnit(@"..\..\..\Test\BizUnit.Tests\Data\FactBasedRuleEngineStepTest.xml", ctx); bizUnit.RunTest(); }
public void Test_10_SoapHttpRequestResponseStepEx() { BizUnit bizUnit = new BizUnit(@".\..\..\TestCases\Test_10_SoapHttpRequestResponseStepEx.xml"); bizUnit.RunTest(); //TODO: this part should really be part of an XML Peek Step XmlDocument xDoc = new XmlDocument(); xDoc.Load(@".\..\..\TestData\out\POResponse.xml"); XmlNode testNode = xDoc.SelectSingleNode("/*[local-name()='submitPOResponse']/*[local-name()='submitPOResult' ]/*[local-name()='InvoiceNumber' ]"); string actualValue = testNode.InnerText; //Do an assertion on the XpAth value Assert.AreEqual("string", actualValue); }
public void Upgrade_NotElligable_Test() { var testCase = new TestCase(); testCase.Name = "Upgrade_NotElligable_Test"; testCase.Purpose = "Test failed upgrade"; testCase.Description = "Test upgrade denied for passenger/flight not elligable for upgrade"; testCase.Category = "BizUnit SDK: BVT"; testCase.Reference = "Use case: 10.3.5"; testCase.ExpectedResults = "Upgrade failed"; testCase.Preconditions = "Solution should be deployed, bound and started"; 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_NotElligible.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 = "false"; validation.XPathValidations.Add(responseXpath); wsStep.SubSteps.Add(validation); testCase.ExecutionSteps.Add(wsStep); var bizUnit = new BizUnit(testCase); bizUnit.RunTest(); TestCase.SaveToFile(testCase, "Upgrade_NotElligable_Test.xml"); }
public void TestGenerator() { string connectionstring = "Provider=OraOLEDB.Oracle;Data Source=10.0.0.233;User Id=vanhos2;Password=vanhos2;Initial Catalog=db11g"; string statements = "SELECT * FROM TESTING; SELECT COUNT(*) AS cnt FROM TESTING"; string delimiter = ";"; int[] recordcounts = new int[] { 1, 1 }; OleDbQuerySequenceStep step = OleDbQuerySequenceStepGenerator.getQuerySequenceStep(connectionstring, statements, delimiter, recordcounts); TestCase btc = new TestCase(); btc.ExecutionSteps.Add(step); BizUnit bu = new BizUnit(btc); bu.RunTest(); }
public void Test_04_FileDeleteEx() { // First make a file for the test to try and delete string path = @".\..\..\TestData\BizUnitTestFile.txt"; string path2 = @".\..\..\TestData\BizUnitTestFile2.txt"; TextWriter ts = File.CreateText(path); ts.WriteLine("This file is used to test the BizUnit fileDeleteExStep."); ts.Close(); ts = File.CreateText(path2); ts.WriteLine("This file is also used to test the BiUnit FileDeleteExStep."); ts.Close(); BizUnit bizUnit = new BizUnit(@".\..\..\TestCases\Test_04_FileDeleteEx.xml"); bizUnit.RunTest(); }
public void ExecuteTestCase() { var btc = new TestCase(); btc.Name = "Serialization Test"; btc.Description = "Test to blah blah blah, yeah really!"; btc.BizUnitVersion = "4.0.0.1"; var fm = new DelayStep { DelayMilliSeconds = 35 }; btc.SetupSteps.Add(fm); var bu = new BizUnit(btc); bu.RunTest(); }
public void Test() { TestCase btc = new TestCase(); var read = new FileFormattedReadMultipleStep() { DirectoryPath = TESTDIRECTORY, FormattedSearchPattern = FILENAME, ExpectedNumberOfFiles = 1, NumberOfCharsToLog = -1, Timeout = 100 }; btc.ExecutionSteps.Add(read); BizUnit bu = new BizUnit(btc); bu.RunTest(); }
public void Test_03_XmlPokeStep() { //setup the steps required //this is the setup stage CreateStep fcStep = new CreateStep(); fcStep.DataSource = new FileDataLoader { FilePath = @".\..\..\TestData\XmlPokeData.xml" }; fcStep.CreationPath = @".\..\..\TestData\XmlPokeDataOut.xml"; //this is the actual execution XmlPokeStep xpStep = new XmlPokeStep(); xpStep.FileName = @".\..\..\TestData\XmlPokeDataOut.xml"; xpStep.Expressions.Add("/PersonObject/partyid||1000"); //Instantiate the test case container TestCase tc = new TestCase(); tc.Name = "Test_03_XmlPokeStep"; //Add the test steps into the container at the required stages tc.SetupSteps.Add(fcStep); tc.ExecutionSteps.Add(xpStep); //Initialise BizUnit runner with the test case container BizUnit bizUnit = new BizUnit(tc); //run the test bizUnit.RunTest(); //Do an ordinary XPath evaluation of the result as part of the assertion //because there is no strong typing of the validation steps XmlDocument xDoc = new XmlDocument(); xDoc.Load(@".\..\..\TestData\XmlPokeDataOut.xml"); XmlNode testNode = xDoc.SelectSingleNode("/PersonObject/partyid"); string actualValue = testNode.InnerText; //Do an assertion on the XpAth value Assert.AreEqual("1000", actualValue); //now delete the file File.Delete(@".\..\..\TestData\XmlPokeDataOut.xml"); }
public void FileCreateStepTest() { string testDirectory = @"..\..\..\Test\BizUnit.Tests\Out"; FileHelper.EmptyDirectory(testDirectory, "*.xml"); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); BizUnitTestCase testCase = new BizUnitTestCase("FileCreateStepTest"); FileCreateStep fcs = new FileCreateStep(); fcs.SourcePath = @"..\..\..\Test\BizUnit.Tests\Data\LoadGenScript001.xml"; fcs.CreationPath = testDirectory + @"\Data_%Guid%.xml"; testCase.AddTestStep(fcs, TestStage.Execution); BizUnit bizUnit = new BizUnit(testCase); bizUnit.RunTest(); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 1); }
public void MqSeriesInvoke() { TestCase btc = new TestCase(); btc.Name = "Send and Read operations on a MQSeries queue"; btc.Description = "Check/Validate the MQSeries related steps"; btc.BizUnitVersion = "4.0.0.1"; const string queueManager = "QM_ACV_LOC"; const string queueName = "QL_LOC_ACV_CTW_CONS_OUT"; // Put a message onto the queue var dataLoader = new FileDataLoader(); dataLoader.FilePath = TestContext.TestDir + @"\..\..\Test\BizUnit.TestSteps.i8c.Tests\TestData\BizTalk2006.ToBeProcessed.A820.Request.xml"; var wsPut = new MQSeriesPutStep(); wsPut.QueueManager = queueManager; wsPut.Queue = queueName; wsPut.MessageBody = dataLoader; // Add step btc.ExecutionSteps.Add(wsPut); // Read and validate the message var wsRead = new MQSeriesGetStep(); wsRead.QueueManager = queueManager; wsRead.Queue = queueName; wsRead.SubSteps.Add(new BinaryValidationStep { ComparisonDataPath = TestContext.TestDir + @"\..\..\Test\BizUnit.TestSteps.i8c.Tests\TestData\BizTalk2006.ToBeProcessed.A820.Request.xml", ReadAsString = true }); // Add step btc.ExecutionSteps.Add(wsRead); // Save and Execute test BizUnit bu = new BizUnit(btc); TestCase.SaveToFile(btc, "MQSeriesInvoke.xaml"); bu.RunTest(); }
public void DelaySampleTest() { // Create the test case var testCase = new TestCase(); // Create test steps... var delayStep = new DelayStep { DelayMilliSeconds = 500 }; // Add test steps to the required test stage testCase.ExecutionSteps.Add(delayStep); // Create a new instance of BizUnit and run the test var bizUnit = new BizUnit(testCase); bizUnit.RunTest(); // Save Test Case TestCase.SaveToFile(testCase, "DelaySampleTest.xml"); }
public void OperatingWindowDisableInvoke() { TestCase btc = new TestCase(); btc.Name = "Enabel a service window on a receive location"; btc.Description = "Check/Validate the related steps"; btc.BizUnitVersion = "4.0.0.1"; var step = new ReceiveLocationOperatingWindowEnabledStep(); step.Enable = false; step.ReceiveLocationName = "Receive Location1"; btc.ExecutionSteps.Add(step); // Save and Execute test BizUnit bu = new BizUnit(btc); TestCase.SaveToFile(btc, "OperatingWindowDisableInvoke.xaml"); bu.RunTest(); }
public void RecycleInvoke() { var btc = new TestCase(); btc.Name = "Recycle an application pool"; btc.Description = "Check/Validate the IIS related steps"; btc.BizUnitVersion = "4.0.0.1"; var iis = new IisRecycleAppPoolStep(); iis.AppPoolName = "BizTalkWebServicesPool"; // Add step btc.ExecutionSteps.Add(iis); // Save and Execute test var bu = new BizUnit(btc); TestCase.SaveToFile(btc, "IISRecycleInvoke.xaml"); bu.RunTest(); }
public void DelaySampleTest() { DeleteFiles(); // Create the test case var testCase = new TestCase(); // Create test steps... var delayStep = new DelayStep {DelayMilliSeconds = 500}; // Add test steps to the required test stage testCase.ExecutionSteps.Add(delayStep); // Create a new instance of BizUnit and run the test var bizUnit = new BizUnit(testCase); bizUnit.RunTest(); // Save Test Case TestCase.SaveToFile(testCase, "DelaySampleTest.xaml"); }
// [ClassInitialize] static public void SetUp(TestContext context) { Console.WriteLine(Environment.CurrentDirectory); BizUnit bizUnit = new BizUnit(@"..\..\..\Test\BizUnit.Tests\TestCases\Test_Setup.xml", TestGroupPhase.TestGroupSetup); bizUnit.RunTest(); }
public void Test_04_NegativeTest_MockLogger() { MockRepository mocks = new MockRepository(); ILogger logger = mocks.CreateMock<ILogger>(); logger.TestStart(null, DateTime.Now, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); // S E T U P logger.TestStageStart(TestStage.Setup, DateTime.Now); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestStageEnd(TestStage.Setup, DateTime.Now, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); // E X E C U T E logger.TestStageStart(TestStage.Execution, DateTime.Now); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestStepStart(null, DateTime.Now, true, true); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestStepEnd(null, DateTime.Now, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestStepStart(null, DateTime.Now, true, true); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.Log(LogLevel.INFO, null); LastCall.On(logger).Repeat.Any().IgnoreArguments(); logger.LogData(null, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.ValidatorStart(null, DateTime.Now); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.Log(LogLevel.INFO, null); LastCall.On(logger).Repeat.Any().IgnoreArguments(); logger.Log(LogLevel.ERROR, null, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.LogException(null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.ValidatorEnd(null, DateTime.Now, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestStepEnd(null, DateTime.Now, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestStageEnd(TestStage.Execution, DateTime.Now, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); // C L E A N U P logger.TestStageStart(TestStage.Cleanup, DateTime.Now); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestStepStart(null, DateTime.Now, true, true); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestStepEnd(null, DateTime.Now, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestStageEnd(TestStage.Cleanup, DateTime.Now, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.TestEnd(null, DateTime.Now, null); LastCall.On(logger).Repeat.Once().IgnoreArguments(); logger.Flush(); logger.Close(); mocks.ReplayAll(); Context ctx = new Context(logger); BizUnit bizUnit = new BizUnit(@"..\..\..\Test\BizUnit.Tests\TestCases\Test_04_NegativeTest.xml", ctx); try { bizUnit.RunTest(); } catch(Exception) {} mocks.VerifyAll(); }
public void Test_02_FILECopyWithBinaryValidation() { BizUnit bizUnit = new BizUnit(@"..\..\..\Test\BizUnit.Tests\TestCases\Test_02_FILECopyWithBinaryValidation.xml"); bizUnit.RunTest(); }
// [ClassCleanup] static public void TearDown() { BizUnit bizUnit = new BizUnit(@"..\..\..\Test\BizUnit.Tests\TestCases\Test_TearDown.xml", TestGroupPhase.TestGroupTearDown); bizUnit.RunTest(); }
public void Test_03_RegExTest() { BizUnit bizUnit = new BizUnit(@"..\..\..\Test\BizUnit.Tests\TestCases\Test_03_RegExTest.xml"); bizUnit.RunTest(); }
public void Create_FileValidateStep_SetPropsAndValidation() { BizUnitTestCase testCase = new BizUnitTestCase("Create_FileValidateStep_SetPropsAndValidation"); // create a file... TestStepBuilder createFileStep = new TestStepBuilder("BizUnit.FileCreateStep", null); object[] args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Data\PurchaseOrder001.xml"; createFileStep.SetProperty("SourcePath", args); args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Out\Data_%Guid%.xml"; createFileStep.SetProperty("CreationPath", args); // Read and validate file... TestStepBuilder tsb = new TestStepBuilder("BizUnit.FileValidateStep", null); args = new object[1]; args[0] = "1000"; tsb.SetProperty("Timeout", args); args[0] = @"..\..\..\Test\BizUnit.Tests\Out"; tsb.SetProperty("Directory", args); args[0] = "*.*"; tsb.SetProperty("SearchPattern", args); args[0] = "true"; tsb.SetProperty("DeleteFile", args); ValidationStepBuilder tssb = new ValidationStepBuilder("BizUnit.XmlValidationStepEx", null); args = new object[1]; args[0] = @"..\..\..\Test\BizUnit.Tests\Data\PurchaseOrder.xsd"; tssb.SetProperty("XmlSchemaPath", args); args[0] = @"http://SendMail.PurchaseOrder"; tssb.SetProperty("XmlSchemaNameSpace", args); args = new object[2]; args[0] = "*[local-name()='PurchaseOrder' and namespace-uri()='http://SendMail.PurchaseOrder']/*[local-name()='PONumber' and namespace-uri()='']"; args[1] = "PONumber_0"; tssb.SetProperty("XPathValidations", args); // set the validation step tsb.ValidationStepBuilder = tssb; // Add the steps... testCase.AddTestStep(createFileStep, TestStage.Execution); testCase.AddTestStep(tsb, TestStage.Execution); string testDirectory = @"..\..\..\Test\BizUnit.Tests\Out"; FileHelper.EmptyDirectory(testDirectory, "*.xml"); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); BizUnit bizUnit = new BizUnit(testCase); bizUnit.RunTest(); Assert.AreEqual(FileHelper.NumberOfFilesInDirectory(testDirectory, "*.xml"), 0); }
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 Test_04_NegativeTest() { BizUnit bizUnit = new BizUnit(@"..\..\..\Test\BizUnit.Tests\TestCases\Test_04_NegativeTest.xml"); bizUnit.RunTest(); }
public void Upgrade_NotElligable_NoResponseValidation_Test() { var testCase = new TestCase(); testCase.Name = "Upgrade_NotElligable_NoResponseValidation_Test"; testCase.Purpose = "Test failed upgrade"; testCase.Description = "Test upgrade denied for passenger/flight not elligable for upgrade"; testCase.Category = "BizUnit SDK: BVT"; testCase.Reference = "Use case: 10.3.5"; testCase.ExpectedResults = "Upgrade failed"; testCase.Preconditions = "Solution should be deployed, bound and started"; 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_NotElligible.xml" }; wsStep.RunConcurrently = true; testCase.ExecutionSteps.Add(wsStep); var bizUnit = new BizUnit(testCase); bizUnit.RunTest(); TestCase.SaveToFile(testCase, "Upgrade_NotElligable_NoResponseValidation_Test.xml"); }
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))); }