Ejemplo n.º 1
0
        public void CommsServer_StopListeningForBroadcastsThrowsIfDisposed()
        {
            var socketFactory = new MockSocketFactory();
            var server        = new SsdpCommunicationsServer(socketFactory);

            server.Dispose();

            server.StopListeningForBroadcasts();
        }
Ejemplo n.º 2
0
        public void CommsServer_StopListeningForBroadcastsDisposesMulticastSocket()
        {
            var socketFactory = new MockSocketFactory();
            var server        = new SsdpCommunicationsServer(socketFactory);

            server.BeginListeningForBroadcasts();
            server.StopListeningForBroadcasts();

            Assert.IsTrue(((DisposableManagedObjectBase)socketFactory.MulticastSocket).IsDisposed);
        }