public void MyTestCleanup() { if (inboundHandler != null) { inboundHandler.StopListener(new TimeSpan(0, 0, 10)); } //inboundHandler.Dispose(); inboundHandler = null; System.Threading.Thread.Sleep(100);//Give some time of the named pipe to cleanup itself. }
public void MyTestInitialize() { //Setting up the inbound handler with all the references connectionUri = new MockAdapterConnectionUri(new Uri("mock://localhost/TestEndpoint")); adapter = new MockAdapter(); adapter.Encoding = "UTF-8"; MockAdapterConnectionFactory connectionFactory = new MockAdapterConnectionFactory( connectionUri, null, adapter); MockAdapterConnection connection = new MockAdapterConnection(connectionFactory); inboundHandler = new MockAdapterInboundHandler(connection, null); inboundHandler.StartListener(null, TimeSpan.FromMinutes(1)); }
private void InitInboundHandler(string address, string adapterProperties) { connectionUri = new MockAdapterConnectionUri(new Uri(address)); adapter = new MockAdapter(); adapter.Encoding = "UTF-8"; if (!string.IsNullOrEmpty(adapterProperties)) { adapter.PromotedProperties = adapterProperties; } MockAdapterConnectionFactory connectionFactory = new MockAdapterConnectionFactory( connectionUri, null, adapter); MockAdapterConnection connection = new MockAdapterConnection(connectionFactory); inboundHandler = new MockAdapterInboundHandler(connection, null); }