Files
ssh.net/test/Renci.SshNet.Tests/Classes/ForwardedPortRemoteTest.cs
dependabot[bot] f5e6ce710c Bump the dependencies group with 11 updates (#1808)
* Bump the dependencies group with 11 updates

Bumps coverlet.collector from 6.0.4 to 10.0.1
Bumps coverlet.msbuild from 6.0.4 to 10.0.1
Bumps GitHubActionsTestLogger from 3.0.1 to 3.0.4
Bumps Meziantou.Analyzer from 3.0.18 to 3.0.114
Bumps Microsoft.Bcl.Cryptography from 10.0.3 to 10.0.9
Bumps Microsoft.Extensions.Logging.Console from 10.0.3 to 10.0.9
Bumps MSTest from 4.1.0 to 4.2.3
Bumps PolySharp from 1.15.0 to 1.16.0
Bumps SonarAnalyzer.CSharp from 10.20.0.135146 to 10.27.0.140913
Bumps System.Formats.Asn1 from 10.0.3 to 10.0.9
Bumps Testcontainers from 4.10.0 to 4.12.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Hague <rh@johnstreetcapital.com>
2026-06-26 17:20:18 +02:00

36 lines
913 B
C#

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Renci.SshNet.Tests.Common;
namespace Renci.SshNet.Tests.Classes
{
/// <summary>
/// Provides functionality for remote port forwarding
/// </summary>
[TestClass]
public class ForwardedPortRemoteTest : TestBase
{
[TestMethod]
public void Start_NotAddedToClient()
{
const int boundPort = 80;
var host = string.Empty;
const uint port = 22;
var target = new ForwardedPortRemote(boundPort, host, port);
try
{
target.Start();
Assert.Fail();
}
catch (InvalidOperationException ex)
{
Assert.IsNull(ex.InnerException);
Assert.AreEqual("Forwarded port is not added to a client.", ex.Message);
}
}
}
}