AsyncResultTest.cs 5.0 KB

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