public void Cleanup() { if (_forwardedPort != null) { _forwardedPort.Dispose(); _forwardedPort = null; } }
public void Dispose() { ForwardedPort.Stop(); ForwardedPort.Dispose(); Ssh.Disconnect(); Ssh?.Dispose(); }
public void DisposeTest() { uint port = 0; // TODO: Initialize to an appropriate value ForwardedPortDynamic target = new ForwardedPortDynamic(port); // TODO: Initialize to an appropriate value target.Dispose(); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void Cleanup() { if (_forwardedPort != null) { _connectionInfoMock.Setup(p => p.Timeout).Returns(TimeSpan.FromSeconds(1)); _forwardedPort.Dispose(); _forwardedPort = null; } }
protected void Arrange() { _closingRegister = new List<EventArgs>(); _exceptionRegister = new List<ExceptionEventArgs>(); _forwardedPort = new ForwardedPortDynamic("host", 22); _forwardedPort.Closing += (sender, args) => _closingRegister.Add(args); _forwardedPort.Exception += (sender, args) => _exceptionRegister.Add(args); _forwardedPort.Dispose(); }
protected void Arrange() { _closingRegister = new List <EventArgs>(); _exceptionRegister = new List <ExceptionEventArgs>(); _forwardedPort = new ForwardedPortDynamic("host", 22); _forwardedPort.Closing += (sender, args) => _closingRegister.Add(args); _forwardedPort.Exception += (sender, args) => _exceptionRegister.Add(args); _forwardedPort.Dispose(); }
protected void Arrange() { _closingRegister = new List<EventArgs>(); _exceptionRegister = new List<ExceptionEventArgs>(); _endpoint = new IPEndPoint(IPAddress.Loopback, 8122); _forwardedPort = new ForwardedPortDynamic(_endpoint.Address.ToString(), (uint)_endpoint.Port); _forwardedPort.Closing += (sender, args) => _closingRegister.Add(args); _forwardedPort.Exception += (sender, args) => _exceptionRegister.Add(args); _forwardedPort.Dispose(); }
protected void Arrange() { _closingRegister = new List <EventArgs>(); _exceptionRegister = new List <ExceptionEventArgs>(); _endpoint = new IPEndPoint(IPAddress.Loopback, 8122); _forwardedPort = new ForwardedPortDynamic(_endpoint.Address.ToString(), (uint)_endpoint.Port); _forwardedPort.Closing += (sender, args) => _closingRegister.Add(args); _forwardedPort.Exception += (sender, args) => _exceptionRegister.Add(args); _forwardedPort.Dispose(); }
public void Cleanup() { if (_client != null) { _client.Dispose(); _client = null; } if (_forwardedPort != null) { _forwardedPort.Dispose(); _forwardedPort = null; } if (_channelBindStarted != null) { _channelBindStarted.Dispose(); _channelBindStarted = null; } if (_channelBindCompleted != null) { _channelBindCompleted.Dispose(); _channelBindCompleted = null; } }
public bool Start_Download(DataTable csvTable) { Progress progress = new Progress(); progress.Set_Max = csvTable.Rows.Count + 6; progress.Show(); progress.Set_Text = "アカウント情報を取得しています..."; progress.Add_ProgressBar(); if (!Input_Account()) { progress.Quit(); return(false); } progress.Set_Text = "SSH接続を試行しています..."; progress.Add_ProgressBar(); if (!Connect_SSH()) { portDynamic.Stop(); portDynamic.Dispose(); sshClient.Disconnect(); sshClient.Dispose(); progress.Quit(); return(false); } progress.Set_Text = "Chromeの準備をしています..."; progress.Add_ProgressBar(); ChromeOptions options = Set_Options(); driver = new ChromeDriver(options); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); progress.Set_Text = "UEC統合認証中..."; progress.Add_ProgressBar(); if (!UEC_Authorization()) { Terminate_Chrome(); progress.Quit(); return(false); } progress.Set_Text = "シラバス検索ページへ遷移中..."; progress.Add_ProgressBar(); if (!Goto_SearchPage()) { Terminate_Chrome(); progress.Quit(); return(false); } foreach (DataRow row in csvTable.Rows) { progress.Set_Text = $"{string.Join(",", row.ItemArray)}を取得中..."; progress.Add_ProgressBar(); if (!Search_Syllabus(row)) { MessageBox.Show($"次の行のシラバス取得に失敗しました。項目を見直してください。\n{string.Join(",", row.ItemArray)}"); if (!Goto_SearchPage()) { Terminate_Chrome(); progress.Quit(); return(false); } continue; } if (!Download_and_Reference_Syllabus(row)) { MessageBox.Show($"次の行のシラバス取得に失敗しました。項目を見直してください。\n{string.Join(",", row.ItemArray)}"); if (!Goto_SearchPage()) { Terminate_Chrome(); progress.Quit(); return(false); } } if (!Goto_SearchPage()) { Terminate_Chrome(); progress.Quit(); return(false); } } progress.Set_Text = "Chromeの終了処理中..."; progress.Add_ProgressBar(); Terminate_Chrome(); progress.Quit(); return(true); }