PageRenderTime 53ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/TestSuite/bin/Debug/TestSuite.XML

#
XML | 399 lines | 399 code | 0 blank | 0 comment | 0 complexity | 399d6bf4a34935f90f5641313b218fe2 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?xml version="1.0"?>
  2. <doc>
  3. <assembly>
  4. <name>TestSuite</name>
  5. </assembly>
  6. <members>
  7. <member name="T:TestSuite.APITestSuite">
  8. <summary>
  9. This class has one static function which activates the test suite.
  10. </summary>
  11. <remarks>
  12. For all tests, the test description that appears on the screen is the
  13. function that is the specific target of the test. Use the test description
  14. and the Error code, along with the following summaries of tests to debug
  15. if a test fails. If a function ever fails, a Debug.Assert is placed in the
  16. code to tell the user where and allow them to examine why it may have
  17. failed. Also, the function returns when a test fails to allow the user to
  18. exit the application if that happens.
  19. </remarks>
  20. <example>
  21. This is an example of how to implement the test suite in an application.
  22. <code>
  23. Text pinText;
  24. int counter = 1;
  25. ...
  26. // Create timer object to allow for output while test is running
  27. DispatcherTimer timer.Interval = new TimeSpan(0, 0, 0, 0, 200);
  28. timer.Start();
  29. // Activate test suite in separate thread
  30. Thread PushedButton = new Thread(new ThreadStart(TestSuite.ActivateTestSuite));
  31. PushedButton.Start();
  32. ...
  33. static void timer_Tick(object sender, EventArgs e)
  34. {
  35. // If test is still running
  36. if (PushedButton.IsAlive)
  37. {
  38. // If a test has recently completed
  39. if (TestSuite.DisplayToScreen)
  40. {
  41. // If the most recent display to screen was not actually
  42. // a test, no need to display information again
  43. if (TestSuite.Test2Info.Substring(0, 3).Equals("All"))
  44. {
  45. pinText.TextContent = "";
  46. }
  47. // If first test, display initial test statement
  48. else if (counter == 0)
  49. {
  50. pinText.TextContent = TestSuite.Test2Info;
  51. counter++;
  52. }
  53. // Else, display that the most recent test passed.
  54. else
  55. {
  56. pinText.TextContent = "Test " + counter++.ToString()
  57. + " passed which tested\n" + TestSuite.Test2Info;
  58. }
  59. //If info was being passed instead of undergoing test display information
  60. if (TestSuite.TestInfo.Substring(0, 3).Equals("All"))
  61. {
  62. pinText.TextContent += "\n\n" + TestSuite.TestInfo;
  63. }
  64. // Otherwise a test was passed, so display message
  65. else
  66. {
  67. pinText.TextContent += "\n\nRunning test " + counter.ToString()
  68. + " which tests\n" + TestSuite.TestInfo;
  69. }
  70. TestSuite.DisplayToScreen = false;
  71. }
  72. }
  73. // All tests were passed, continue with application
  74. else if (TestSuite.TestInfo == "All tests passed")
  75. {
  76. // Continue with application
  77. }
  78. // A test failed, output necessary information and exit application
  79. else
  80. {
  81. SCardError err = SCard.GetError();
  82. pinText.TextContent = "Test " + counter.ToString() + " failed which tested\n"
  83. + TestSuite.TestInfo + "\nExiting application"
  84. + "\nError: " + SCard.StringifyError(err);
  85. myApplication.Shutdown();
  86. }
  87. }
  88. </code>
  89. </example>
  90. </member>
  91. <member name="M:TestSuite.APITestSuite.ActivateTestSuite">
  92. <summary>
  93. This function calls the specific tests, updates the
  94. testing information for output, tells the user when to output,
  95. and pauses after each test.
  96. </summary>
  97. <remarks>
  98. This test suite does not test a working Control command, as that
  99. is a reader specific test. It is advised that Control is tested
  100. in order to insure correctness.
  101. </remarks>
  102. </member>
  103. <member name="M:TestSuite.APITestSuite.ChangeStatus">
  104. <summary>
  105. Function used to call GetStatusChange in separate Thread
  106. </summary>
  107. </member>
  108. <member name="M:TestSuite.APITestSuite.Test01">
  109. <summary>
  110. Test 1: EstablishContext
  111. </summary>
  112. <remarks>
  113. Establish 2 contexts. Create third context using constructor.
  114. If error occurs here, it would occur in SCard.EstablishContext
  115. function or Device.ConnectReader.
  116. </remarks>
  117. <returns>True if test passes, false otherwise</returns>
  118. </member>
  119. <member name="M:TestSuite.APITestSuite.Test02">
  120. <summary>
  121. Test 2: ReleaseContext
  122. </summary>
  123. <remarks>
  124. Release 1 context. If error occurs here, it would occur
  125. in SCard.ReleaseContext.
  126. </remarks>
  127. <returns>True if test passes, false otherwise</returns>
  128. </member>
  129. <member name="M:TestSuite.APITestSuite.Test03">
  130. <summary>
  131. Test 3: IsValidContext
  132. </summary>
  133. <remarks>
  134. Check if all created contexts are valid along with a null context.
  135. If error occurs here, it would occur in SCard.EstablishContext,
  136. SCard.ReleaseContext (are not functioning properly) or
  137. SCard.IsValidContext.
  138. </remarks>
  139. <returns>True if test passes, false otherwise</returns>
  140. </member>
  141. <member name="M:TestSuite.APITestSuite.Test04">
  142. <summary>
  143. Test 4: ReleaseContext
  144. </summary>
  145. <remarks>
  146. Release all created contexts along with a null context. If error occurs
  147. here, it would occur in SCard.EstablishContext (is not functioning
  148. properly), SCard.ReleaseContext or Device.DisconnectReader. After test 4,
  149. assume that all of the above tested functions are working properly.
  150. </remarks>
  151. <returns>True if test passes, false otherwise</returns>
  152. </member>
  153. <member name="M:TestSuite.APITestSuite.Test05">
  154. <summary>
  155. Test 5: GetStatusChange
  156. </summary>
  157. <remarks>
  158. Call GetStatusChange on context that was created using constructor.
  159. Then call GetStatusChange with invalid timeout value. Then call
  160. GetStatusChange on valid context with timeout 0. If error occurs here,
  161. it would occur in SCard.GetStatusChange, Device.GetStatus or
  162. Device.UpdateStatus (if implemented).
  163. </remarks>
  164. <returns>True if test passes, false otherwise</returns>
  165. </member>
  166. <member name="M:TestSuite.APITestSuite.Test06">
  167. <summary>
  168. Test 6: GetStatusChange
  169. </summary>
  170. <remarks>
  171. Call GetStatusChange on valid context with timeout 100 to test that
  172. GetStatusChange will return eventually if given a timeout value not
  173. equal to infinite. If error occurs here, it would occur in
  174. SCard.GetStatusChange, Device.GetStatus or Device.UpdateStatus
  175. (if implemented).
  176. </remarks>
  177. <returns>True if test passes, false otherwise</returns>
  178. </member>
  179. <member name="M:TestSuite.APITestSuite.Test07">
  180. <summary>
  181. Test 7: GetStatusChange
  182. </summary>
  183. <remarks>
  184. Call GetStatusChange in a new thread with timeout 100, and then in
  185. current thread call GetStatusChange with same context and different
  186. context. This tests GetStatusChange’s ability to block the reader.
  187. If error occurs here, it would occur in SCard.GetStatusChange,
  188. Device.GetStatus or Device.UpdateStatus (if implemented).
  189. </remarks>
  190. <returns>True if test passes, false otherwise</returns>
  191. </member>
  192. <member name="M:TestSuite.APITestSuite.Test08">
  193. <summary>
  194. Test 8: GetStatusChange
  195. </summary>
  196. <remarks>
  197. Call GetStatusChange with timeout 0 to get the current status and prepare
  198. for test 9. If error occurs here, it would occur in SCard.GetStatusChange,
  199. Device.GetStatus or Device.UpdateStatus (if implemented).
  200. </remarks>
  201. <returns>True if test passes, false otherwise</returns>
  202. </member>
  203. <member name="M:TestSuite.APITestSuite.Test09">
  204. <summary>
  205. Test 9: GetStatusChange
  206. </summary>
  207. <remarks>
  208. Then if the status is present (or activated), call GetStatusChange with
  209. timeout infinite twice to force user to remove and then reinsert the card.
  210. If status is absent, call GetStatusChange with timeout infinite three
  211. times to force user to insert, then remove and reinsert the card. This
  212. specifically tests the ability of the reader to notice a present or absent
  213. card. If error occurs here, it would occur in SCard.GetStatusChange,
  214. Device.GetStatus or Device.UpdateStatus (if implemented).
  215. </remarks>
  216. <returns>True if test passes, false otherwise</returns>
  217. </member>
  218. <member name="M:TestSuite.APITestSuite.Test10">
  219. <summary>
  220. Test 10: Cancel
  221. </summary>
  222. <remarks>
  223. Call Cancel to make sure it does nothing if GetStatusChange has not
  224. been called. Then call GetStatusChange, wait for it to finish, and call
  225. Cancel to make sure it still does nothing. This specifically tests the
  226. ability of the reader to notice a present or absent card. If error
  227. occurs here, it would occur in SCard.Cancel.
  228. </remarks>
  229. <returns>True if test passes, false otherwise</returns>
  230. </member>
  231. <member name="M:TestSuite.APITestSuite.Test11">
  232. <summary>
  233. Test 11: Cancel
  234. </summary>
  235. <remarks>
  236. Call GetStatusChange in a new thread. Then call Cancel with the wrong
  237. context to get an error. Then call Cancel with correct context. If error
  238. occurs here, it would occur in SCard.Cancel or SCard.GetStatusChange.
  239. After test 11, assume that Cancel works properly.
  240. </remarks>
  241. <returns>True if test passes, false otherwise</returns>
  242. </member>
  243. <member name="M:TestSuite.APITestSuite.Test12">
  244. <summary>
  245. Test 12: Connect
  246. </summary>
  247. <remarks>
  248. Connect one card with a valid context and one with an invalid context.
  249. If error occurs here, it would occur in SCard.Connect,
  250. Device.ActivateCard, or Device.SendPPS.
  251. </remarks>
  252. <returns>True if test passes, false otherwise</returns>
  253. </member>
  254. <member name="M:TestSuite.APITestSuite.Test13">
  255. <summary>
  256. Test 13: Status
  257. </summary>
  258. <remarks>
  259. Call Status on card and GetStatusChange with timeout 0 on the corresponding
  260. context to verify that the data is the same. If error occurs here, it would
  261. occur in SCard.Status, SCard.GetStatusChange, Device.GetStatus, or
  262. Device.UpdateStatus (if implemented).
  263. </remarks>
  264. <returns>True if test passes, false otherwise</returns>
  265. </member>
  266. <member name="M:TestSuite.APITestSuite.Test14">
  267. <summary>
  268. Test 14: Reconnect and Disconnect
  269. </summary>
  270. <remarks>
  271. Call Disconnect and Reconnect on invalid cards. Then Connect a new card,
  272. Disconnect it with unpower as the Disposition and Reconnect a different
  273. card. Lastly Connect a new card and Disconnect it to verify functionality
  274. of Disconnect. If error occurs here, it would occur in SCard.Disconnect,
  275. SCard.Reconnect, Device.DeactivateCard, or Device.ActivateCard.
  276. </remarks>
  277. <returns>True if test passes, false otherwise</returns>
  278. </member>
  279. <member name="M:TestSuite.APITestSuite.Test15">
  280. <summary>
  281. Test 15: GetStatusChange
  282. </summary>
  283. <remarks>
  284. Call GetStatusChange in a new thread and then verify that it blocks the
  285. functionality of Connect, Reconnect, Disconnect, and Status. If error
  286. occurs here, it would occur in SCard.Disconnect, SCard.Reconnect,
  287. SCard.Connect, SCard.Status, or SCard.GetStatusChange. After test 15,
  288. assume that Status, Disconnect, and Reconnect, DeactivateCard and
  289. ActivateCard function properly.
  290. </remarks>
  291. <returns>True if test passes, false otherwise</returns>
  292. </member>
  293. <member name="M:TestSuite.APITestSuite.Test16">
  294. <summary>
  295. Test 16: Begin and End Transaction
  296. </summary>
  297. <remarks>
  298. Connect a new card, and then call EndTransaction to make sure it fails.
  299. Then call BeginTransaction and EndTransaction right after. If error occurs
  300. here, it would occur in SCard.BeginTransaction or SCard.EndTransaction.
  301. </remarks>
  302. <returns>True if test passes, false otherwise</returns>
  303. </member>
  304. <member name="M:TestSuite.APITestSuite.Test17">
  305. <summary>
  306. Test 17: Transmit, Control, and StringifyAPDU
  307. </summary>
  308. <remarks>
  309. Call Transmit and then StringifyAPDUResponse on the response. If error
  310. occurs here, it would occur in SCard.Transmit or SCard.StringifyAPDUResponse,
  311. Device.SendPPS, or Device.SendAPDU.
  312. </remarks>
  313. <returns>True if test passes, false otherwise</returns>
  314. </member>
  315. <member name="M:TestSuite.APITestSuite.Test18">
  316. <summary>
  317. Test 18: Transmit, Control, and StringifyAPDU
  318. </summary>
  319. <remarks>
  320. Call BeginTransaction, then call Transmit followed by StringifyAPDUResponse
  321. on the same card, then Transmit and StringifyAPDUResponse on a different card,
  322. and then Control on a different card. Then call EndTransaction. If error
  323. occurs here, it would occur in SCard.BeginTransaction, SCard.EndTransaction,
  324. SCard.Transmit, SCard.StringifyAPDUResponse, SCard.Control, Device.SendPPS,
  325. or Device.SendAPDU.
  326. </remarks>
  327. <returns>True if test passes, false otherwise</returns>
  328. </member>
  329. <member name="M:TestSuite.APITestSuite.Test19">
  330. <summary>
  331. Test 19: Transmit, Control, and StringifyAPDU
  332. </summary>
  333. <remarks>
  334. Call Transmit on both cards to verify that the transaction was actually
  335. ended. If error occurs here, it would occur in SCard.Transmit or
  336. SCard.EndTransaction, Device.SendPPS, or Device.SendAPDU.
  337. </remarks>
  338. <returns>True if test passes, false otherwise</returns>
  339. </member>
  340. <member name="M:TestSuite.APITestSuite.Test20">
  341. <summary>
  342. Test 20: GetStatusChange
  343. </summary>
  344. <remarks>
  345. Call GetStatusChange in a new thread and then verify that it blocks the
  346. functionality of BeginTransaction, EndTransaction, Control, and Transmit.
  347. If error occurs here, it would occur in SCard.BeginTransaction,
  348. SCard.EndTransaction, SCard.Control, SCard.Transmit, or SCard.GetStatusChange.
  349. </remarks>
  350. <returns>True if test passes, false otherwise</returns>
  351. </member>
  352. <member name="M:TestSuite.APITestSuite.Test21">
  353. <summary>
  354. Test 21: BeginTransaction
  355. </summary>
  356. <remarks>
  357. Call BeginTransaction and then verify that it blocks the functionality
  358. of Transmit, Control, Status, GetStatusChange, Connect, Disconnect, and
  359. Reconnect on another card. Then call EndTransaction. If error occurs
  360. here, it would occur in SCard.BeginTransaction, SCard.Control,
  361. SCard.Transmit, SCard.Connect, SCard.Disconnect, SCard.Reconnect,
  362. SCard.Status, SCard.GetStatusChange, or SCard.EndTransaction.
  363. </remarks>
  364. <returns>True if test passes, false otherwise</returns>
  365. </member>
  366. <member name="M:TestSuite.APITestSuite.Test22">
  367. <summary>
  368. Test 22: Connect
  369. </summary>
  370. <remarks>
  371. Call Connect with exclusive rights and then verify that it blocks the
  372. functionality of BeginTransaction, Transmit, Control, Status,
  373. GetStatusChange, Connect, Disconnect, and Reconnect, EndTransaction
  374. another card. Then call Transmit to verify that Connect with exclusive
  375. rights allows itself to Transmit APDUs. If error occurs here, it would
  376. occur in SCard.Connect, SCard.BeginTransaction, SCard.Control,
  377. SCard.Transmit, SCard.Disconnect, SCard.Reconnect, SCard.Status,
  378. SCard.GetStatusChange, or SCard.EndTransaction. After test 22, assume
  379. that all tested functions work properly.
  380. </remarks>
  381. <returns>True if test passes, false otherwise</returns>
  382. </member>
  383. <member name="P:TestSuite.APITestSuite.TestInfo">
  384. <summary>
  385. Get information on current test
  386. </summary>
  387. </member>
  388. <member name="P:TestSuite.APITestSuite.Test2Info">
  389. <summary>
  390. Get information on most recent test
  391. </summary>
  392. </member>
  393. <member name="P:TestSuite.APITestSuite.DisplayToScreen">
  394. <summary>
  395. Get whether test has just been passed
  396. </summary>
  397. </member>
  398. </members>
  399. </doc>