示例#1
0
 public void Cleanup()
 {
     if (_forwardedPort != null)
     {
         _forwardedPort.Dispose();
         _forwardedPort = null;
     }
 }
示例#2
0
 public void DisposeTest()
 {
     uint boundPort = 0; // TODO: Initialize to an appropriate value
     string host = string.Empty; // TODO: Initialize to an appropriate value
     uint port = 0; // TODO: Initialize to an appropriate value
     ForwardedPortRemote target = new ForwardedPortRemote(boundPort, host, port); // TODO: Initialize to an appropriate value
     target.Dispose();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
示例#3
0
        [Ignore] // placeholder
        public void DisposeTest()
        {
            uint   boundPort           = 0;                                              // TODO: Initialize to an appropriate value
            string host                = string.Empty;                                   // TODO: Initialize to an appropriate value
            uint   port                = 0;                                              // TODO: Initialize to an appropriate value
            ForwardedPortRemote target = new ForwardedPortRemote(boundPort, host, port); // TODO: Initialize to an appropriate value

            target.Dispose();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
示例#4
0
 public void Cleanup()
 {
     if (_forwardedPort != null)
     {
         _sessionMock.Setup(p => p.ConnectionInfo).Returns(_connectionInfoMock.Object);
         _connectionInfoMock.Setup(p => p.Timeout).Returns(TimeSpan.FromSeconds(1));
         _forwardedPort.Dispose();
         _forwardedPort = null;
     }
 }
示例#5
0
        protected void Arrange()
        {
            var random = new Random();
            _closingRegister = new List<EventArgs>();
            _exceptionRegister = new List<ExceptionEventArgs>();
            _bindEndpoint = new IPEndPoint(IPAddress.Any, random.Next(IPEndPoint.MinPort, IPEndPoint.MaxPort));
            _remoteEndpoint  = new IPEndPoint(IPAddress.Parse("193.168.1.5"), random.Next(IPEndPoint.MinPort, IPEndPoint.MaxPort));

            _forwardedPort = new ForwardedPortRemote(_bindEndpoint.Address, (uint) _bindEndpoint.Port, _remoteEndpoint.Address, (uint) _remoteEndpoint.Port);
            _forwardedPort.Closing += (sender, args) => _closingRegister.Add(args);
            _forwardedPort.Exception += (sender, args) => _exceptionRegister.Add(args);
            _forwardedPort.Dispose();
        }
        protected void Arrange()
        {
            var random = new Random();
            _closingRegister = new List<EventArgs>();
            _exceptionRegister = new List<ExceptionEventArgs>();
            _bindEndpoint = new IPEndPoint(IPAddress.Any, random.Next(IPEndPoint.MinPort, IPEndPoint.MaxPort));
            _remoteEndpoint = new IPEndPoint(IPAddress.Parse("193.168.1.5"), random.Next(IPEndPoint.MinPort, IPEndPoint.MaxPort));
            _forwardedPort = new ForwardedPortRemote(_bindEndpoint.Address, (uint)_bindEndpoint.Port, _remoteEndpoint.Address, (uint)_remoteEndpoint.Port);

            _forwardedPort.Closing += (sender, args) => _closingRegister.Add(args);
            _forwardedPort.Exception += (sender, args) => _exceptionRegister.Add(args);
            _forwardedPort.Dispose();
        }
示例#7
0
 public void Cleanup()
 {
     if (_forwardedPort != null)
     {
         _sessionMock.Setup(
             p =>
             p.SendMessage(
                 It.Is <CancelTcpIpForwardGlobalRequestMessage>(
                     g => g.AddressToBind == _forwardedPort.BoundHost && g.PortToBind == _forwardedPort.BoundPort)));
         _sessionMock.Setup(p => p.MessageListenerCompleted).Returns(new ManualResetEvent(true));
         _forwardedPort.Dispose();
         _forwardedPort = null;
     }
 }