public void CanReconnectSameConnection() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket = new Socket<IAudioStream>(); socket.ConnectTo(plug); socket.ConnectTo(plug).Should().Be.True(); }
public void ConnectingSetsSocketChannel() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket = new Socket<IAudioStream>(); socket.ConnectTo(plug); Assert.Same(stream, socket.Channel); }
public void ConnectedPlugIsConnected() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket = new Socket<IAudioStream>(); socket.ConnectTo(plug); plug.IsConnected.Should().Be.True(); }
public void CannotConnectToNewPlugWithoutDisconnecting() { var stream1 = Substitute.For<IAudioStream>(); var plug1 = new Plug<IAudioStream>(stream1); var stream2 = Substitute.For<IAudioStream>(); var plug2 = new Plug<IAudioStream>(stream2); var socket = new Socket<IAudioStream>(); socket.ConnectTo(plug1); socket.ConnectTo(plug2).Should().Be.False(); }
public void DisconnectingSocketDisconnectsPlug() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket = new Socket<IAudioStream>(); socket.ConnectTo(plug); socket.Disconnect(); plug.IsConnected.Should().Be.False(); }
public void CannotConnectNewSocketWithoutDisconnecting() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket1 = new Socket<IAudioStream>(); var socket2 = new Socket<IAudioStream>(); socket1.ConnectTo(plug); socket2.ConnectTo(plug).Should().Be.False(); }