Esempio n. 1
0
        public void StopAsync()
        {
            Listener newListener = transport.MakeListener(address);

            Assert.True(newListener == transport.GetListener(address));
            transport.StopAsync();
            Assert.False(transport.ListenerExists(address));
            transport.MakeListener(address);
            Assert.True(transport.ListenerExists(address));
        }
Esempio n. 2
0
        public async Task DefaultSetup(IService service, int count)
        {
            transport = transportBuilder.Construct();
            listener = (SimpleInMemListener)transport.MakeListener(address);
            listener.AddService(service);
            await listener.StartAsync();

            connections = new SimpleInMemConnection[count];

            for (int connectionIndex = 0; connectionIndex < count; connectionIndex++)
            {
                connections[connectionIndex] = (SimpleInMemConnection)await transport.ConnectToAsync(address, System.Threading.CancellationToken.None);
                Assert.IsTrue(connections[connectionIndex].IsConnected);
                Assert.IsTrue(connections[connectionIndex].IsPaired);
            }
        }
        public async Task DefaultSetup(IService service, int count)
        {
            transport = transportBuilder.Construct();
            listener  = (SimpleInMemListener)transport.MakeListener(address);
            listener.AddService(service);
            await listener.StartAsync();

            connections = new SimpleInMemConnection[count];

            for (int connectionIndex = 0; connectionIndex < count; connectionIndex++)
            {
                connections[connectionIndex] = (SimpleInMemConnection)await transport.ConnectToAsync(address, System.Threading.CancellationToken.None);

                Assert.IsTrue(connections[connectionIndex].IsConnected);
                Assert.IsTrue(connections[connectionIndex].IsPaired);
            }
        }
Esempio n. 4
0
        public void CreateInMemTransportListener()
        {
            var listener = transport.MakeListener(address);

            Assert.IsNotNull(listener);
        }