public void CanConnectPlugToSocket() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket = new Socket<IAudioStream>(); plug.ConnectTo(socket).Should().Be.True(); }
public void ConnectingSetsSocketChannel() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket = new Socket<IAudioStream>(); plug.ConnectTo(socket); Assert.Same(stream, socket.Channel); }
public void ConnectedSocketIsConnected() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket = new Socket<IAudioStream>(); plug.ConnectTo(socket); socket.IsConnected.Should().Be.True(); }
public void CannotConnectToNewSocketWithoutDisconnecting() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket1 = new Socket<IAudioStream>(); var socket2 = new Socket<IAudioStream>(); plug.ConnectTo(socket1); plug.ConnectTo(socket2).Should().Be.False(); }
public void DisconnectingPlugDisconnectsSocket() { var stream = Substitute.For<IAudioStream>(); var plug = new Plug<IAudioStream>(stream); var socket = new Socket<IAudioStream>(); plug.ConnectTo(socket); plug.Disconnect(); socket.IsConnected.Should().Be.False(); }
public void CannotConnectNewPlugWithoutDisconnecting() { 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>(); plug1.ConnectTo(socket); plug2.ConnectTo(socket).Should().Be.False(); }