示例#1
0
 private static void TestCore(Action <ServerRequestContext, ServerTransport> test)
 {
     using (var server = new RpcServer())
         using (var manager = new NullServerTransportManager(server))
             using (var transport = new NullServerTransport(manager))
                 using (var target = new ServerRequestContext())
                 {
                     test(target, transport);
                 }
 }
 public void TestSetTransportPool_Twice_Fail()
 {
     using (var server = new RpcServer())
         using (var target = new Target(server))
             using (var transportManager = new NullServerTransportManager(server))
                 using (var transportPool =
                            new OnTheFlyObjectPool <NullServerTransport>(
                                conf => new NullServerTransport(transportManager),
                                server.Configuration.CreateTransportPoolConfiguration()
                                )
                        )
                 {
                     target.InvokeSetTransportPool(transportPool);
                     target.InvokeSetTransportPool(transportPool);
                 }
 }
 public void TestSetTransportPool_NotNull_IsTransportPoolTrue()
 {
     using (var server = new RpcServer())
         using (var target = new Target(server))
             using (var transportManager = new NullServerTransportManager(server))
                 using (var transportPool =
                            new OnTheFlyObjectPool <NullServerTransport>(
                                conf => new NullServerTransport(transportManager),
                                server.Configuration.CreateTransportPoolConfiguration()
                                )
                        )
                 {
                     target.InvokeSetTransportPool(transportPool);
                     Assert.That(target.GetIsTransportPoolSet());
                 }
 }