CreateTransport() public method

public CreateTransport ( Uri location ) : ITransport
location System.Uri
return ITransport
コード例 #1
0
 public void CreationFailMockTransportTest()
 {
     MockTransportFactory factory = new MockTransportFactory();
     
     Uri location = new Uri("mock://0.0.0.0:61616?transport.failOnCreate=true");
     
     factory.CreateTransport(location);
 }
コード例 #2
0
        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 );
        }