public void CommsServer_StopListeningForBroadcastsThrowsIfDisposed() { var socketFactory = new MockSocketFactory(); var server = new SsdpCommunicationsServer(socketFactory); server.Dispose(); server.StopListeningForBroadcasts(); }
public void CommsServer_StopListeningForBroadcastsDisposesMulticastSocket() { var socketFactory = new MockSocketFactory(); var server = new SsdpCommunicationsServer(socketFactory); server.BeginListeningForBroadcasts(); server.StopListeningForBroadcasts(); Assert.IsTrue(((DisposableManagedObjectBase)socketFactory.MulticastSocket).IsDisposed); }