Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        public void WebServiceInvoke()
        {
            TestCase btc = new TestCase();

            btc.Name           = "Send SOAP message to BizTalk";
            btc.Description    = "Send a SOAP message to BizTalk as would have done Horizon";
            btc.BizUnitVersion = "4.0.0.1";

            var ws = new WebServiceStep();

            ws.Action = "http://bts.online.bizilante.intranet/ACVCSC.BizTalk.WebServiceInterface/SubmitRequest";
            FileDataLoader dataLoader;

            dataLoader               = new FileDataLoader();
            dataLoader.FilePath      = @"..\..\..\BizUnit.TestSteps.i8c.Tests\TestData\SubmitRequest.xml";
            ws.RequestBody           = dataLoader;
            ws.ServiceUrl            = "http://localhost:8888/ACVCSC.BizTalk.Common.WebServiceInterface/Common.asmx";
            ws.UseDefaultCredentials = true;
            ws.HasResponse           = false;

            // Validation....

            // Add steps
            btc.ExecutionSteps.Add(ws);

            // Save and Execute test
            BizUnit bu = new BizUnit(btc);

            TestCase.SaveToFile(btc, "WebServiceInvoke.xaml");
            bu.RunTest();
        }
Ejemplo n.º 3
0
        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");
        }
Ejemplo n.º 4
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");
        }
Ejemplo n.º 5
0
        public void WebServiceInvoke()
        {
            TestCase btc = new TestCase();

            btc.Name           = "Serialization Test";
            btc.Description    = "Test to blah blah blah, yeah really!";
            btc.BizUnitVersion = "4.0.0.1";

            var ws = new WebServiceStep();

            ws.Action = "http://schemas.virgin-atlantic.com/AncillarySales/Book/Services/2009/IAncillarySalesBook/GetProductTermsAndConditions";
            FileDataLoader dataLoader;

            dataLoader          = new FileDataLoader();
            dataLoader.FilePath = @"..\..\..\Test\BizUnit.TestSteps.Tests\TestData\GetProductTermsAndConditions_RQ.xml";
            ws.RequestBody      = dataLoader;
            ws.ServiceUrl       = "http://localhost/AncillarySalesBook/AncillarySalesBook.svc";
            ws.Username         = @"newkydog001\kevinsmi";
            var header = new SoapHeader();

            header.HeaderName      = "ServiceCallingContext";
            header.HeaderNameSpace = "http://schemas.virgin-atlantic.com/Services/ServiceCallingContext/2009";

            var ctx = new ServiceCallingContext();

            ctx.ApplicationName         = "BVT Tests";
            ctx.GUid                    = "{1705141E-F530-4657-BA2F-23F0F4A8BCB0}";
            ctx.RequestId               = "{59ACDBB4-3FAF-4056-9459-49D43C4128F9}";
            ctx.UserId                  = "kevin";
            ctx.UTCTransactionStartDate = DateTime.UtcNow;
            ctx.UTCTransactionStartTime = DateTime.UtcNow.ToString("HH:mm:ss.fff");
            header.HeaderInstance       = ctx;
            ws.SoapHeaders.Add(header);

            // Validation....
            var validation       = new XmlValidationStep();
            var schemaResultType = new SchemaDefinition
            {
                XmlSchemaPath =
                    @"C:\Affinus\Depot\ASS\Main\Dev\Src\VAA.ASS.Schemas\VAACommon\Result_Type.xsd",
                XmlSchemaNameSpace =
                    "http://schemas.virgin-atlantic.com/Common/2009"
            };

            validation.XmlSchemas.Add(schemaResultType);
            var schema = new SchemaDefinition
            {
                XmlSchemaPath =
                    @"C:\Affinus\Depot\ASS\Main\Dev\Src\VAA.ASS.Schemas\Book\GetProductTermsAndConditions_RS.xsd",
                XmlSchemaNameSpace =
                    "http://schemas.virgin-atlantic.com/AncillarySales/Book/Services/GetProductTermsAndConditions/2009"
            };

            validation.XmlSchemas.Add(schema);

            var xpathProductId = new XPathDefinition();

            xpathProductId.XPath = "/*[local-name()='GetProductTermsAndConditions_RS' and namespace-uri()='http://schemas.virgin-atlantic.com/AncillarySales/Book/Services/GetProductTermsAndConditions/2009']/*[local-name()='Message' and namespace-uri()='']/*[local-name()='TermsAndConditions' and namespace-uri()='']/@*[local-name()='productId' and namespace-uri()='']";
            xpathProductId.Value = "1";
            validation.XPathValidations.Add(xpathProductId);

            var xpathContent = new XPathDefinition();

            xpathContent.XPath = "/*[local-name()='GetProductTermsAndConditions_RS' and namespace-uri()='http://schemas.virgin-atlantic.com/AncillarySales/Book/Services/GetProductTermsAndConditions/2009']/*[local-name()='Message' and namespace-uri()='']/*[local-name()='TermsAndConditions' and namespace-uri()='']/*[local-name()='Content' and namespace-uri()='']";
            xpathContent.Value = "Terms and Conditions: this product is non-refundable....";
            validation.XPathValidations.Add(xpathContent);

            ws.SubSteps.Add(validation);
            btc.ExecutionSteps.Add(ws);

            BizUnit bu = new BizUnit(btc);

            TestCase.SaveToFile(btc, "WebServiceInvoke.xaml");
            bu.RunTest();
        }