public void RemoveAddress_WithUnaddedAddress_DoesNothing() { // Arrange var socket = new PublisherSocket(); var publisher = new NetMQPublisher(socket, messageFactory); // Act TestDelegate removeAddress = () => publisher.RemoveAddress(address); // Assert Assert.That(removeAddress, Throws.Nothing); // Cleanup publisher.Dispose(); }
public void RemoveAddress_WithAddedAddress_RemovesFromAddresses() { // Arrange var socket = new PublisherSocket(); var publisher = new NetMQPublisher(socket, messageFactory); publisher.AddAddress(address); // Act publisher.RemoveAddress(address); // Assert CollectionAssert.DoesNotContain(publisher.Addresses, address); // Cleanup publisher.Dispose(); }
public void Remove_WithAddedAddress_IsConnectedFalse() { // Arrange var socket = new PublisherSocket(); var publisher = new NetMQPublisher(socket, messageFactory); var address = TcpAddress.Wildcard(5555); publisher.AddAddress(address); // Act publisher.RemoveAddress(address); // Assert Assert.That(publisher.IsConnected, Is.False); // Cleanup publisher.Dispose(); }
public void Remove_WithAddedAddress_IsConnectedTrue() { // Arrange var socket = new PublisherSocket(); var publisher = new NetMQPublisher(socket, messageFactory); var address = TcpAddress.Wildcard(5555); var address2 = TcpAddress.Wildcard(5556); publisher.AddAddress(address); publisher.AddAddress(address2); publisher.InitializeConnection(); // Act publisher.RemoveAddress(address); // Assert Assert.That(publisher.IsConnected, Is.True); // Cleanup publisher.TerminateConnection(); publisher.Dispose(); }