AsyncResultTest.cs 5.0 KB

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