AsyncResultTest.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. using System;
  2. using Microsoft.VisualStudio.TestTools.UnitTesting;
  3. using Renci.SshNet.Common;
  4. using Renci.SshNet.Tests.Common;
  5. namespace Renci.SshNet.Tests.Classes.Common
  6. {
  7. /// <summary>
  8. ///This is a test class for AsyncResultTest and is intended
  9. ///to contain all AsyncResultTest Unit Tests
  10. ///</summary>
  11. [TestClass]
  12. [Ignore] // placeholder for actual test
  13. public class AsyncResultTest : TestBase
  14. {
  15. /// <summary>
  16. ///A test for EndInvoke
  17. ///</summary>
  18. public void EndInvokeTest1Helper<TResult>()
  19. {
  20. var target = CreateAsyncResult<TResult>(); // TODO: Initialize to an appropriate value
  21. var expected = default(TResult); // TODO: Initialize to an appropriate value
  22. var actual = target.EndInvoke();
  23. Assert.AreEqual(expected, actual);
  24. Assert.Inconclusive("Verify the correctness of this test method.");
  25. }
  26. internal virtual AsyncResult<TResult> CreateAsyncResult<TResult>()
  27. {
  28. // TODO: Instantiate an appropriate concrete class.
  29. AsyncResult<TResult> target = null;
  30. return target;
  31. }
  32. [TestMethod]
  33. public void EndInvokeTest1()
  34. {
  35. EndInvokeTest1Helper<GenericParameterHelper>();
  36. }
  37. /// <summary>
  38. ///A test for SetAsCompleted
  39. ///</summary>
  40. public void SetAsCompletedTest1Helper<TResult>()
  41. {
  42. var target = CreateAsyncResult<TResult>(); // TODO: Initialize to an appropriate value
  43. TResult result = default; // TODO: Initialize to an appropriate value
  44. var completedSynchronously = false; // TODO: Initialize to an appropriate value
  45. target.SetAsCompleted(result, completedSynchronously);
  46. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  47. }
  48. [TestMethod]
  49. public void SetAsCompletedTest1()
  50. {
  51. SetAsCompletedTest1Helper<GenericParameterHelper>();
  52. }
  53. internal virtual AsyncResult CreateAsyncResult()
  54. {
  55. // TODO: Instantiate an appropriate concrete class.
  56. AsyncResult target = null;
  57. return target;
  58. }
  59. /// <summary>
  60. ///A test for EndInvoke
  61. ///</summary>
  62. [TestMethod]
  63. public void EndInvokeTest()
  64. {
  65. var target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
  66. target.EndInvoke();
  67. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  68. }
  69. /// <summary>
  70. ///A test for SetAsCompleted
  71. ///</summary>
  72. [TestMethod]
  73. public void SetAsCompletedTest()
  74. {
  75. var target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
  76. Exception exception = null; // TODO: Initialize to an appropriate value
  77. var completedSynchronously = false; // TODO: Initialize to an appropriate value
  78. target.SetAsCompleted(exception, completedSynchronously);
  79. Assert.Inconclusive("A method that does not return a value cannot be verified.");
  80. }
  81. /// <summary>
  82. ///A test for AsyncState
  83. ///</summary>
  84. [TestMethod]
  85. public void AsyncStateTest()
  86. {
  87. var target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
  88. var actual = target.AsyncState;
  89. Assert.Inconclusive("Verify the correctness of this test method.");
  90. }
  91. /// <summary>
  92. ///A test for AsyncWaitHandle
  93. ///</summary>
  94. [TestMethod]
  95. public void AsyncWaitHandleTest()
  96. {
  97. var target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
  98. var actual = target.AsyncWaitHandle;
  99. Assert.Inconclusive("Verify the correctness of this test method.");
  100. }
  101. /// <summary>
  102. ///A test for CompletedSynchronously
  103. ///</summary>
  104. [TestMethod]
  105. public void CompletedSynchronouslyTest()
  106. {
  107. var target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
  108. var actual = target.CompletedSynchronously;
  109. Assert.Inconclusive("Verify the correctness of this test method.");
  110. }
  111. /// <summary>
  112. ///A test for IsCompleted
  113. ///</summary>
  114. [TestMethod]
  115. public void IsCompletedTest()
  116. {
  117. var target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
  118. var actual = target.IsCompleted;
  119. Assert.Inconclusive("Verify the correctness of this test method.");
  120. }
  121. }
  122. }