public void Execute1WayStepTest() { SubmitMockMessage1WayStep target = new SubmitMockMessage1WayStep("Mock submission test"); // TODO: Initialize to an appropriate value target.DestURI = "http://*****:*****@"BizWTF.Testing.Sample.Messages.Mock-Demo-Enveloppe.xml"; target.SourceResourceAssembly = System.Reflection.Assembly.GetExecutingAssembly().FullName; bool expected = true; bool actual = target.ExecuteStep(); Assert.AreEqual(expected, actual); //Assert.Inconclusive("Verify the correctness of this test method."); }
// // You can use the following additional attributes as you write your tests: // // Use ClassInitialize to run code before running the first test in the class // [ClassInitialize()] // public static void MyClassInitialize(TestContext testContext) { } // // Use ClassCleanup to run code after all tests in a class have run // [ClassCleanup()] // public static void MyClassCleanup() { } // // Use TestInitialize to run code before running each test // [TestInitialize()] // public void MyTestInitialize() { } // // Use TestCleanup to run code after each test has run // [TestCleanup()] // public void MyTestCleanup() { } // #endregion //[TestMethod] public void TestProcess_Standard() { SubmitMockMessage1WayStep smm = new SubmitMockMessage1WayStep("Mock submission test"); // TODO: Initialize to an appropriate value smm.DestURI = "http://*****:*****@"C:\Temp\BizWTF\BizWTF.SubmissionTest - Enveloppe.xml"; //WaitStep ws1 = new WaitStep("Wait until process starts"); //ws1.Seconds = 1; SynchronizeProcessDebugStep sp = new SynchronizeProcessDebugStep("Test synchro : BizWTF.Sample.Processes.Processes.TestOrch1"); sp.ProcessName = "BizWTF.Sample.Processes.TestOrch1"; sp.TargetContextProperty = "ServiceInstanceID"; sp.ContextProps.Add(new ControlProperty(BTSProperties.messageType.Name.Namespace, BTSProperties.messageType.Name.Name, "http://BizWTF.Sample.Processes.Demo#Demo")); sp.XPathProps.Add(new ControlField("/*[local-name()='Demo']/*[local-name()='Field1']", "Test1")); ForceTrackedMessageCopyJobStep ftmc = new ForceTrackedMessageCopyJobStep("Wait until tracking job executes"); GetProcessDebugStep gp = new GetProcessDebugStep("Orchestration query : BizWTF.Sample.Processes.Processes.TestOrch1"); gp.ProcessName = sp.ProcessName; gp.SourceContextProperty = "ServiceInstanceID"; gp.TargetContextProperty = "OrchestrationInstanceInfo"; gp.ContextProps.Add(new ControlProperty(BTSProperties.messageType.Name.Namespace, BTSProperties.messageType.Name.Name, "http://BizWTF.Sample.Processes.Demo#Demo")); gp.XPathProps.Add(new ControlField("/*[local-name()='Demo']/*[local-name()='Field1']", "Test1")); TestProcessDebugStep tp = new TestProcessDebugStep("Orchestration test : BizWTF.Sample.Processes.Processes.TestOrch1"); tp.SourceContextProperty = "OrchestrationInstanceInfo"; DebugTrace expectedTrace = new DebugTrace(); DebugShape shape = new DebugShape(); shape.shapeType = ShapeTypes.ReceiveShape; shape.shapeText = "Rcv input msg"; shape.ShapeID = new Guid("5386ed66-aca3-4f68-af0b-d5c9f042a7f6"); expectedTrace.TraceDetails.Add(shape); shape = new DebugShape(); shape.shapeType = ShapeTypes.DelayShape; shape.shapeText = "Delay 10s"; shape.ShapeID = new Guid("5e08ebcc-ac83-4b52-a48f-d4f94b723c9e"); expectedTrace.TraceDetails.Add(shape); shape = new DebugShape(); shape.shapeType = ShapeTypes.SendShape; shape.shapeText = "Send output msg"; shape.ShapeID = new Guid("345b65b4-a222-4703-b55a-946bd4550d11"); expectedTrace.TraceDetails.Add(shape); tp.Scenario = expectedTrace; TimeLine tl = new TimeLine(); List <TimeLineStep> ts = new List <TimeLineStep>(); ts.Add(new TimeLineStep(smm)); //ts.Add(new TimeLineStep(ws1)); ts.Add(new TimeLineStep(sp)); ts.Add(new TimeLineStep(ftmc)); ts.Add(new TimeLineStep(gp)); ts.Add(new TimeLineStep(tp)); tl.Steps = ts; tl.ExportTimeLine(@"C:\Projects\BizWTF\BizWTF.Testing.Sample\Resources\TimeLine1.xml"); tl.Execute(); }
public void Call1WayMock() { using (Init1WayMockMessagingService oneWayTarget = new Init1WayMockMessagingService { StepName = "Init 1-Way mock service", ServiceURI = "http://*****:*****@"BizWTF.Testing.Sample.Messages.Mock-Demo-1WayMockService.xml"; send1WayMsgStep.SourceResourceAssembly = System.Reflection.Assembly.GetExecutingAssembly().FullName; // In this case, the resource is embedded in the current assembly send1WayMsgStep.TestID = send1WayMsgStep.TestID; // NOTE : you can provide a test ID, wich will be attached as a message property. This facilitates instance tracking. /// NOTE : the folowwing code actually sends the message. /// Nevertheless, it is recommended to first initialize all the steps of the test before executing any of them. if (!send1WayMsgStep.ExecuteStep()) { Assert.Fail(send1WayMsgStep.ResultDescription); } int iterationCount = 0; while (!msgReceived) { iterationCount++; System.Threading.Thread.Sleep(1000); if (iterationCount == 1000) { Assert.Fail("No message was received"); break; } } } }