public void CreationFailMockTransportTest() { MockTransportFactory factory = new MockTransportFactory(); Uri location = new Uri("mock://0.0.0.0:61616?transport.failOnCreate=true"); factory.CreateTransport(location); }
public void CreateMockTransportWithParamsTest() { MockTransportFactory factory = new MockTransportFactory(); Uri location = new Uri("mock://0.0.0.0:61616?transport.failOnSendMessage=true&transport.numSentMessagesBeforeFail=20"); MockTransport transport = (MockTransport) factory.CompositeConnect(location); Assert.IsNotNull(transport); Assert.IsTrue(transport.FailOnSendMessage); Assert.AreEqual(20, transport.NumSentMessagesBeforeFail); }
public void CreateMockTransportTest() { MockTransportFactory factory = new MockTransportFactory(); Uri location = new Uri("mock://0.0.0.0:61616"); ITransport transport = factory.CreateTransport(location); Assert.IsNotNull(transport); Assert.IsInstanceOf<MockTransport>(transport.Narrow(typeof(MockTransport))); MockTransport mock = (MockTransport) transport.Narrow(typeof(MockTransport)); Assert.IsTrue( mock.IsConnected ); Assert.IsFalse( mock.IsFaultTolerant ); }
public void SetUp() { this.received = new List<Command>(); this.exceptions = new List<Exception>(); Uri uri = new Uri("mock://mock?wireformat=openwire"); MockTransportFactory factory = new MockTransportFactory(); this.transport = factory.CompositeConnect( uri ) as MockTransport; this.localWireFormatInfo = new WireFormatInfo(); this.localWireFormatInfo.Version = 5; this.localWireFormatInfo.MaxInactivityDuration = 3000; this.localWireFormatInfo.TightEncodingEnabled = false; }