mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-10-18 06:21:30 +08:00
03ae6bfa0f
* Bump the dependencies group with 4 updates Bumps BouncyCastle.Cryptography from 2.6.1 to 2.6.2 Bumps Meziantou.Analyzer from 2.0.205 to 2.0.210 Bumps MSTest from 3.9.3 to 3.10.0 Bumps SonarAnalyzer.CSharp from 10.13.0.120203 to 10.15.0.120848 Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rob Hague <rob.hague00@gmail.com>
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
using System;
|
|
using System.Globalization;
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
using Renci.SshNet.Tests.Common;
|
|
|
|
namespace Renci.SshNet.Tests.Classes
|
|
{
|
|
/// <summary>
|
|
/// Provides functionality for "none" authentication method
|
|
/// </summary>
|
|
[TestClass]
|
|
public class NoneAuthenticationMethodTest : TestBase
|
|
{
|
|
[TestMethod]
|
|
public void None_Test_Pass_Null()
|
|
{
|
|
Assert.ThrowsExactly<ArgumentNullException>(() => new NoneAuthenticationMethod(null));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void None_Test_Pass_Whitespace()
|
|
{
|
|
Assert.ThrowsExactly<ArgumentException>(() => new NoneAuthenticationMethod(string.Empty));
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Name()
|
|
{
|
|
var username = new Random().Next().ToString(CultureInfo.InvariantCulture);
|
|
var target = new NoneAuthenticationMethod(username);
|
|
|
|
Assert.AreEqual("none", target.Name);
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Username()
|
|
{
|
|
var username = new Random().Next().ToString(CultureInfo.InvariantCulture);
|
|
var target = new NoneAuthenticationMethod(username);
|
|
|
|
Assert.AreSame(username, target.Username);
|
|
}
|
|
}
|
|
}
|