public void TestOneWayFlow_NewSyntax() { var epMock = new EndpointsMock <BizTalkTestsMockAddresses>(); epMock.SetupReceive( r => r.BTS_OneWayReceive2_FILE); epMock.SetupSend( s => s.BTS_OneWaySendFILE); var messanger = epMock.CreateMessagingClient(); messanger .Send( r => r.BTS_OneWayReceive2_FILE, "StartMessage.xml", System.Text.Encoding.UTF8, 10, beforeSendAction: ctx => ctx.DebugInfo("Sending messagein to OneWayReceive2_FILE") ) .Receive( s => s.BTS_OneWaySendFILE, beforeReceiveAction: ctx => ctx.DebugInfo("Receiving message from BTS_OneWaySendFILE"), validator: v => { Assert.IsTrue(v.Index == 0, "Message index is wrong!"); Assert.IsTrue(v.Message.Body.Length > 0, "Received message is empty"); return(true); } ); }
public void TestServiceBusAdapterProperties_HappyPath() { var serviceMock = new EndpointsMock <BizTalkTestsMockAddresses>(); serviceMock.SetupReceive(r => r.BTS_OneWayReceive3_SBus) .SetupSend(s => s.BTS_OneWayTestSend_SBus); var messagingClient = serviceMock.CreateMessagingClient(); messagingClient.Send(r => r.BTS_OneWayReceive3_SBus, "StartMessage.xml", messagePropertiesSetter: msp => msp.Add( SBMessaging.CorrelationId, "SomeCorrelationID") ) .Receive(s => s.BTS_OneWayTestSend_SBus, validator: v => ValidateCorrelationId(v, "SomeCorrelationID")); }
public void SimpleFlow_HappyPath() { var integrationMock = new EndpointsMock <TestMockAddresses>(); integrationMock .SetupReceive(a => a.ReceiveFirstMessage_FILE) .SetupSend(a => a.SendFirstMessage_FILE); var emulator = integrationMock.CreateMessagingClient(); emulator .Send(r => r.ReceiveFirstMessage_FILE, "TestFileIn.txt", System.Text.Encoding.UTF8, 10, beforeSendAction: ctx => ctx.DebugInfo("Fire in the hall") ) .Receive( s => s.SendFirstMessage_FILE, beforeReceiveAction: ctx => ctx.DebugInfo("Yet one more blast!"), validator: v => { return(v.Message.Body.Length > 0); }); }