public void RemoveAddress_WithNoAddresses_DoesNothing() { // Arrange var socket = new DealerSocket(); var sender = new NetMQSender(socket, messageFactory); // Act TestDelegate remove = () => sender.RemoveAddress(address); // Assert Assert.That(remove, Throws.Nothing); // Cleanup sender.Dispose(); }
public void RemoveAddress_WithAddedAddress_RemovesFromAddressList() { // Arrange var socket = new DealerSocket(); var sender = new NetMQSender(socket, messageFactory); sender.AddAddress(address); // Act sender.RemoveAddress(address); // Assert CollectionAssert.IsEmpty(sender.Addresses); // Cleanup sender.Dispose(); }
public void Remove_WithAddedAddress_IsConnectedFalse() { // Arrange var socket = new DealerSocket(); var sender = new NetMQSender(socket, messageFactory); var address = TcpAddress.Wildcard(5555); sender.AddAddress(address); // Act sender.RemoveAddress(address); // Assert Assert.That(sender.IsConnected, Is.False); // Cleanup sender.Dispose(); }
public void Remove_WithAddedAddress_IsConnectedTrue() { // Arrange var socket = new DealerSocket(); var sender = new NetMQSender(socket, messageFactory); var address = TcpAddress.Wildcard(5555); var address2 = TcpAddress.Wildcard(5556); sender.AddAddress(address); sender.AddAddress(address2); sender.InitializeConnection(); // Act sender.RemoveAddress(address); // Assert Assert.That(sender.IsConnected, Is.True); // Cleanup sender.TerminateConnection(); sender.Dispose(); }