mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-10-18 14:36:11 +08:00
f5e6ce710c
* 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>
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System;
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
using Renci.SshNet.Tests.Common;
|
|
|
|
namespace Renci.SshNet.Tests.Classes
|
|
{
|
|
/// <summary>
|
|
/// Provides functionality to perform password authentication.
|
|
/// </summary>
|
|
[TestClass]
|
|
public class PasswordAuthenticationMethodTest : TestBase
|
|
{
|
|
[TestMethod]
|
|
public void Password_Test_Pass_Null_Username()
|
|
{
|
|
Assert.ThrowsExactly<ArgumentNullException>(() => new PasswordAuthenticationMethod(null, "valid"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Password_Test_Pass_Null_Password()
|
|
{
|
|
Assert.ThrowsExactly<ArgumentNullException>(() => new PasswordAuthenticationMethod("valid", (string)null));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Password_Test_Pass_Valid_Username_And_Password()
|
|
{
|
|
new PasswordAuthenticationMethod("valid", "valid");
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Password_Test_Pass_Whitespace()
|
|
{
|
|
Assert.ThrowsExactly<ArgumentException>(() => new PasswordAuthenticationMethod(string.Empty, "valid"));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Password_Test_Pass_Valid()
|
|
{
|
|
new PasswordAuthenticationMethod("valid", string.Empty);
|
|
}
|
|
}
|
|
}
|