2
0

PrivateKeyAuthenticationMethodTest.cs 997 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using Microsoft.VisualStudio.TestTools.UnitTesting;
  3. using Renci.SshNet.Tests.Common;
  4. namespace Renci.SshNet.Tests.Classes
  5. {
  6. /// <summary>
  7. /// Provides functionality to perform private key authentication.
  8. /// </summary>
  9. [TestClass]
  10. public class PrivateKeyAuthenticationMethodTest : TestBase
  11. {
  12. [TestMethod]
  13. [ExpectedException(typeof(ArgumentNullException))]
  14. public void PrivateKey_Test_Pass_Null()
  15. {
  16. new PrivateKeyAuthenticationMethod(null, null);
  17. }
  18. [TestMethod]
  19. [ExpectedException(typeof(ArgumentNullException))]
  20. public void PrivateKey_Test_Pass_PrivateKey_Null()
  21. {
  22. new PrivateKeyAuthenticationMethod("username", null);
  23. }
  24. [TestMethod]
  25. [ExpectedException(typeof(ArgumentException))]
  26. public void PrivateKey_Test_Pass_Whitespace()
  27. {
  28. new PrivateKeyAuthenticationMethod(string.Empty, null);
  29. }
  30. }
  31. }