Ejemplo n.º 1
0
        public void TestHappyPath_TwoWay_HelperClass()
        {
            var testCase = new BizUnit.Core.TestBuilder.TestCase();

            var inMsgStep = new MockSendStep()
            {
                Url         = BizTalkTests.Test.BizTalkTestsMockAddresses.BTS_OneWayReceive2_FILE,
                RequestPath = "StartMessage.xml",
                Encoding    = "UTF-8"
            };

            testCase.ExecutionSteps.Add(inMsgStep);

            var outMsgStep = new MockRequestResponseStep()
            {
                Url          = BizTalkTests.Test.BizTalkTestsMockAddresses.DynamicPortOut2Way,
                Encoding     = "UTF-8",
                ResponsePath = "ResponseMessage.xml",
                Timeout      = 10
            };

            testCase.ExecutionSteps.Add(outMsgStep);

            BizUnit.Core.TestRunner testRunner = new BizUnit.Core.TestRunner(testCase);

            testRunner.Run();
        }
Ejemplo n.º 2
0
        public void TestOneWay_HappyPath()
        {
            var testCase = new BizUnit.Core.TestBuilder.TestCase();

            var inMsgStep = new MockSendStep()
            {
                Url         = BizTalkTestsMockAddresses.BTS_OneWayStaticReceive_FILE,
                RequestPath = "StartMessage.xml",
                Encoding    = "UTF-8"
            };

            testCase.ExecutionSteps.Add(inMsgStep);

            var outMsgStep = new MockReceiveStep()
            {
                Url      = BizTalkTestsMockAddresses.BTS_OneWaySendFILE,
                Encoding = "UTF-8",
                Timeout  = 10
            };

            var outMsgValidationStep = new TransMock.Integration.BizUnit.Validation.LambdaValidationStep()
            {
                MessageValidationCallback = (message) => ValidateOutMessage(message)
            };

            outMsgStep.SubSteps.Add(outMsgValidationStep);
            testCase.ExecutionSteps.Add(outMsgStep);

            BizUnit.Core.TestRunner testRunner = new BizUnit.Core.TestRunner(testCase);

            testRunner.Run();
        }
Ejemplo n.º 3
0
        public void TestHappyPath_OneWay()
        {
            var testCase = new BizUnit.Core.TestBuilder.TestCase();

            var inMsgStep = new MockSendStep()
            {
                Url         = "mock://localhost/BTS.OneWayReceive_FILE",
                RequestPath = "StartMessage.xml",
                Encoding    = "UTF-8"
            };

            testCase.ExecutionSteps.Add(inMsgStep);

            var outMsgStep = new MockReceiveStep()
            {
                Url      = "mock://localhost/DynamicPortOut",
                Encoding = "UTF-8",
                Timeout  = 10
            };

            testCase.ExecutionSteps.Add(outMsgStep);

            BizUnit.Core.TestRunner testRunner = new BizUnit.Core.TestRunner(testCase);

            testRunner.Run();
        }
Ejemplo n.º 4
0
        public void TestOneWay_InboundMessageProperties_HappyPath()
        {
            var testCase = new BizUnit.Core.TestBuilder.TestCase();

            var inMsgStep = new MockSendStep()
            {
                Url         = BizTalkTestsOldMockAddresses.BTS_OneWayReceive2_FILE.ToString(),
                RequestPath = "StartMessage.xml",
                Encoding    = "UTF-8"
            };

            inMsgStep.MessageProperties
            .Add(
                TransMock.Wcf.Adapter.Utils.BizTalkProperties.BTS.Operation,
                "SomeTestOperation");

            testCase.ExecutionSteps.Add(inMsgStep);

            var outMsgStep = new MockReceiveStep()
            {
                Url      = BizTalkTestsOldMockAddresses.BTS_OneWaySendFILE.ToString(),
                Encoding = "UTF-8",
                Timeout  = 10
            };

            var outMsgValidationStep = new TransMock.Integration.BizUnit.Validation.LambdaValidationStep()
            {
                MessageValidationCallback = (message) => ValidateOutMessage(message)
            };

            outMsgStep.SubSteps.Add(outMsgValidationStep);
            testCase.ExecutionSteps.Add(outMsgStep);

            BizUnit.Core.TestRunner testRunner = new BizUnit.Core.TestRunner(testCase);

            testRunner.Run();
        }