public void ShouldHandleObjectDisposedOnReceive() { Exception ex = null; _wrapper.Dispose(); _wrapper.Receive(new byte[1], i => {}, e => { ex = e; }, 0); Assert.IsInstanceOf <ObjectDisposedException>(ex); }
public Connection(int connectionId, Manager manager, Socket client, IPEndPoint serverDestination) { _connectionId = connectionId; _manager = manager; Client = new SocketWrapper(client); _serverDestination = serverDestination; _packetProcessor = new PacketProcessor(_connectionId); Client.DataReceivedEvent += ClientOnDataReceivedEvent; Client.Receive(); }
public void ShouldHandleObjectDisposedOnReceive() { _wrapper.Dispose(); _wrapper.Receive(new byte[1], i => { }, Assert.IsInstanceOf <ObjectDisposedException>, 0); }