예제 #1
0
        public void Remove_WithUnaddedAddress_DoesNothing()
        {
            // Arrange
            var socket   = new RouterSocket();
            var receiver = new NetMQReceiver(socket, messageFactory, requestDispatcher);

            // Act
            TestDelegate test = () => receiver.RemoveAddress(TcpAddress.Wildcard(5555));

            // Assert
            Assert.That(test, Throws.Nothing);

            // Cleanup
            receiver.Dispose();
        }
예제 #2
0
        public void Remove_WithAddedAddress_IsConnectedFalse()
        {
            // Arrange
            var socket   = new RouterSocket();
            var receiver = new NetMQReceiver(socket, messageFactory, requestDispatcher);
            var address  = TcpAddress.Wildcard(5555);

            receiver.AddAddress(address);

            // Act
            receiver.RemoveAddress(address);

            // Assert
            Assert.That(receiver.IsConnected, Is.False);

            // Cleanup
            receiver.Dispose();
        }
예제 #3
0
        public void Remove_WithAddedAddress_RemovesAddress()
        {
            // Arrange
            var socket   = new RouterSocket();
            var receiver = new NetMQReceiver(socket, messageFactory, requestDispatcher);
            var address  = TcpAddress.Wildcard(5555);

            receiver.AddAddress(address);

            // Act
            receiver.RemoveAddress(address);

            // Assert
            CollectionAssert.DoesNotContain(receiver.Addresses, address);

            // Cleanup
            receiver.Dispose();
        }