using System;
using System.Globalization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Renci.SshNet.Tests.Common;
namespace Renci.SshNet.Tests.Classes
{
    /// 
    /// Provides functionality for "none" authentication method
    /// 
    [TestClass]
    public class NoneAuthenticationMethodTest : TestBase
    {
        [TestMethod]
        public void None_Test_Pass_Null()
        {
            Assert.ThrowsExactly(() => new NoneAuthenticationMethod(null));
        }
        [TestMethod]
        public void None_Test_Pass_Whitespace()
        {
            Assert.ThrowsExactly(() => 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);
        }
    }
}