Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated core to latest version, changed namespace, marged all demo fi…

…les in one project, implemented Nuget Parallel Task Library
  • Loading branch information...
commit 3e695d623ebe35b8cf1cbb50c620ac13bebd3803 1 parent 107f3a2
Petro authored
Showing with 7,779 additions and 19,716 deletions.
  1. +0 −22 silverlight/3.3.0.1/PubNub-Messaging.Tests/App.config
  2. +0 −526 silverlight/3.3.0.1/PubNub-Messaging.Tests/EncryptionTests.cs
  3. +0 −35 silverlight/3.3.0.1/PubNub-Messaging.Tests/Properties/AssemblyInfo.cs
  4. +0 −78 silverlight/3.3.0.1/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj
  5. +0 −6 silverlight/3.3.0.1/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj.user
  6. +0 −119 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenAClientIsPresented.cs
  7. +0 −444 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenAMessageIsPublished.cs
  8. +0 −174 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenDetailedHistoryIsRequested.cs
  9. +0 −64 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenGetRequestServerTime.cs
  10. +0 −63 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenSubscribedToAChannel.cs
  11. BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/Newtonsoft.Json.dll
  12. BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.dll
  13. +0 −22 silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.dll.config
  14. BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.pdb
  15. BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.exe
  16. BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.pdb
  17. BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  18. +0 −29 silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.csproj.FileListAbsolute.txt
  19. BIN  ...rlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.csprojResolveAssemblyReference.cache
  20. BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.dll
  21. BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.pdb
  22. +0 −82 silverlight/3.3.0.1/PubNub-Messaging/DetailedHistory_Example.cs
  23. +0 −39 silverlight/3.3.0.1/PubNub-Messaging/Here_Now_Example.cs
  24. +0 −74 silverlight/3.3.0.1/PubNub-Messaging/PresenceUnsubscribe_Example.cs
  25. +0 −157 silverlight/3.3.0.1/PubNub-Messaging/Presence_Example.cs
  26. +0 −114 silverlight/3.3.0.1/PubNub-Messaging/PubNub-Messaging.csproj
  27. +0 −13 silverlight/3.3.0.1/PubNub-Messaging/PubNub-Messaging.csproj.user
  28. +0 −114 silverlight/3.3.0.1/PubNub-Messaging/Publish_Example.cs
  29. +0 −3,012 silverlight/3.3.0.1/PubNub-Messaging/Pubnub.cs
  30. +0 −213 silverlight/3.3.0.1/PubNub-Messaging/Pubnub_Example.cs
  31. +0 −226 silverlight/3.3.0.1/PubNub-Messaging/Subscribe_Example.cs
  32. +0 −21 silverlight/3.3.0.1/PubNub-Messaging/app.config
  33. BIN  silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/Newtonsoft.Json.dll
  34. BIN  silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/PubNub-Messaging.exe
  35. +0 −21 silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/PubNub-Messaging.exe.config
  36. BIN  silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/PubNub-Messaging.pdb
  37. BIN  silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/PubNub-Messaging.vshost.exe
  38. +0 −21 silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/PubNub-Messaging.vshost.exe.config
  39. +0 −11 silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/PubNub-Messaging.vshost.exe.manifest
  40. +0 −357 silverlight/3.3.0.1/PubNub-Messaging/bin/Debug/pubnub-messaging.log
  41. BIN  silverlight/3.3.0.1/PubNub-Messaging/bin/Release/Newtonsoft.Json.dll
  42. BIN  silverlight/3.3.0.1/PubNub-Messaging/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  43. +0 −19 silverlight/3.3.0.1/PubNub-Messaging/obj/x86/Debug/PubNub-Messaging.csproj.FileListAbsolute.txt
  44. BIN  silverlight/3.3.0.1/PubNub-Messaging/obj/x86/Debug/PubNub-Messaging.exe
  45. BIN  silverlight/3.3.0.1/PubNub-Messaging/obj/x86/Debug/PubNub-Messaging.pdb
  46. BIN  silverlight/3.3.0.1/PubNubMeter.Core/Bin/Debug/PubNubMeter.Core.dll
  47. BIN  silverlight/3.3.0.1/PubNubMeter.Core/Bin/Debug/PubNubMeter.Core.pdb
  48. +0 −18 silverlight/3.3.0.1/PubNubMeter.Core/Meter.cs
  49. +0 −35 silverlight/3.3.0.1/PubNubMeter.Core/Properties/AssemblyInfo.cs
  50. +0 −76 silverlight/3.3.0.1/PubNubMeter.Core/PubNubMeter.Core.csproj
  51. +0 −29 silverlight/3.3.0.1/PubNubMeter.Core/PubNubMeter.Core.csproj.user
  52. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/ConcurrentHashtable_Silverlight.dll
  53. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/Newtonsoft.Json.dll
  54. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Core.dll
  55. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Core.pdb
  56. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Imports.dll
  57. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/Bin/Debug/PubnubSilverlight.Imports.pdb
  58. +0 −73 silverlight/3.3.0.1/PubnubSilverlight.Core/ConcurrentDictionaryExtentions.cs
  59. +0 −35 silverlight/3.3.0.1/PubnubSilverlight.Core/Properties/AssemblyInfo.cs
  60. +0 −90 silverlight/3.3.0.1/PubnubSilverlight.Core/PubnubSilverlight.Core.csproj
  61. +0 −32 silverlight/3.3.0.1/PubnubSilverlight.Core/PubnubSilverlight.Core.csproj.user
  62. +0 −2,932 silverlight/3.3.0.1/PubnubSilverlight.Core/PubnubV3.cs
  63. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  64. +0 −34 silverlight/3.3.0.1/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.csproj.FileListAbsolute.txt
  65. BIN  ...rlight/3.3.0.1/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.csprojResolveAssemblyReference.cache
  66. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.dll
  67. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/obj/Debug/PubnubSilverlight.Core.pdb
  68. BIN  silverlight/3.3.0.1/PubnubSilverlight.Core/obj/Debug/ResolveAssemblyReference.cache
  69. 0  ...ght/3.3.0.1/PubnubSilverlight.Core/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
  70. 0  ...ght/3.3.0.1/PubnubSilverlight.Core/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
  71. 0  ...ght/3.3.0.1/PubnubSilverlight.Core/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
  72. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/ClientBin/PubnubSilverlight.Example.xap
  73. +0 −37 silverlight/3.3.0.1/PubnubSilverlight.Example.Web/Properties/AssemblyInfo.cs
  74. +0 −100 silverlight/3.3.0.1/PubnubSilverlight.Example.Web/PubnubSilverlight.Web.csproj
  75. +0 −30 silverlight/3.3.0.1/PubnubSilverlight.Example.Web/PubnubSilverlight.Web.csproj.user
  76. +0 −74 silverlight/3.3.0.1/PubnubSilverlight.Example.Web/PubnubSilverlightExample.aspx
  77. +0 −73 silverlight/3.3.0.1/PubnubSilverlight.Example.Web/PubnubSilverlightExample.html
  78. +0 −2  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/Silverlight.js
  79. +0 −30 silverlight/3.3.0.1/PubnubSilverlight.Example.Web/Web.Debug.config
  80. +0 −31 silverlight/3.3.0.1/PubnubSilverlight.Example.Web/Web.Release.config
  81. +0 −13 silverlight/3.3.0.1/PubnubSilverlight.Example.Web/Web.config
  82. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/bin/PubnubSilverlight.Example.Web.dll
  83. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/bin/PubnubSilverlight.Example.Web.pdb
  84. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/bin/PubnubSilverlight.Web.dll
  85. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/bin/PubnubSilverlight.Web.pdb
  86. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  87. +0 −5 ...t/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug/PubnubSilverlight.Example.Web.csproj.FileListAbsolute.txt
  88. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug/PubnubSilverlight.Example.Web.dll
  89. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug/PubnubSilverlight.Example.Web.pdb
  90. +0 −22 silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug/PubnubSilverlight.Web.csproj.FileListAbsolute.txt
  91. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug/PubnubSilverlight.Web.dll
  92. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.Web/obj/Debug/PubnubSilverlight.Web.pdb
  93. +0 −84 silverlight/3.3.0.1/PubnubSilverlight.Example.sln
  94. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example.suo
  95. +1 −1  silverlight/3.3.0.1/PubnubSilverlight.Example/App.xaml
  96. +1 −1  silverlight/3.3.0.1/PubnubSilverlight.Example/App.xaml.cs
  97. +4 −6 silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/AppManifest.xaml
  98. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Core.dll
  99. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Core.pdb
  100. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.dll
  101. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.pdb
  102. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Example.xap
  103. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Imports.dll
  104. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.Imports.pdb
  105. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.UnitTest.dll
  106. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/PubnubSilverlight.UnitTest.pdb
  107. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/System.Threading.Tasks.SL5.dll
  108. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/Bin/Debug/System.Threading.Tasks.SL5.pdb
  109. +737 −341 silverlight/3.3.0.1/{PubnubSilverlight.Core/PubnubV5.cs → PubnubSilverlight.Example/Core/Pubnub.cs}
  110. +1 −1  silverlight/3.3.0.1/PubnubSilverlight.Example/Dialogs/PublishMessageDialog.xaml
  111. +1 −1  silverlight/3.3.0.1/PubnubSilverlight.Example/Dialogs/PublishMessageDialog.xaml.cs
  112. +106 −106 silverlight/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/ArrayList.cs
  113. +3,592 −3,592 silverlight/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/AtlasWeb.cs
  114. +108 −108 silverlight/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/HttpEncoder.cs
  115. +16 −16 ...erlight/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/JavaScriptConverter.cs
  116. +409 −409 ....3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/JavaScriptObjectDeserializer.cs
  117. +549 −549 ...rlight/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/JavaScriptSerializer.cs
  118. +78 −78 silverlight/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/JavaScriptString.cs
  119. +13 −13 ...ight/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/JavaScriptTypeResolver.cs
  120. +471 −471 silverlight/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/ObjectConverter.cs
  121. +8 −8 ...light/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/ScriptIgnoreAttribute.cs
  122. +40 −40 silverlight/3.3.0.1/{PubnubSilverlight.Imports → PubnubSilverlight.Example/Imports}/Trace.cs
  123. +1 −1  silverlight/3.3.0.1/PubnubSilverlight.Example/MainView.xaml
  124. +1 −4 silverlight/3.3.0.1/PubnubSilverlight.Example/MainView.xaml.cs
  125. +30 −12 silverlight/3.3.0.1/PubnubSilverlight.Example/PubnubSilverlight.Example.csproj
  126. +527 −528 silverlight/3.3.0.1/{PubnubSilverlight.UnitTest → PubnubSilverlight.Example/UnitTest}/EncryptionTests.cs
  127. +28 −28 silverlight/3.3.0.1/{PubnubSilverlight.UnitTest → PubnubSilverlight.Example/UnitTest}/Main.cs
  128. +121 −121 ...ht/3.3.0.1/{PubnubSilverlight.UnitTest → PubnubSilverlight.Example/UnitTest}/WhenAClientIsPresented.cs
  129. +491 −492 ...t/3.3.0.1/{PubnubSilverlight.UnitTest → PubnubSilverlight.Example/UnitTest}/WhenAMessageIsPublished.cs
  130. +193 −193 ....1/{PubnubSilverlight.UnitTest → PubnubSilverlight.Example/UnitTest}/WhenDetailedHistoryIsRequested.cs
  131. +69 −70 .../3.3.0.1/{PubnubSilverlight.UnitTest → PubnubSilverlight.Example/UnitTest}/WhenGetRequestServerTime.cs
  132. +66 −67 .../3.3.0.1/{PubnubSilverlight.UnitTest → PubnubSilverlight.Example/UnitTest}/WhenSubscribedToAChannel.cs
  133. +1 −1  silverlight/3.3.0.1/PubnubSilverlight.Example/Views/CodeExampleView.xaml
  134. +1 −3 silverlight/3.3.0.1/PubnubSilverlight.Example/Views/CodeExampleView.xaml.cs
  135. +1 −1  silverlight/3.3.0.1/PubnubSilverlight.Example/Views/CodeUnitTestView.xaml
  136. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/Views/CodeUnitTestView.xaml.cs
  137. +1 −1  silverlight/3.3.0.1/PubnubSilverlight.Example/Views/ErrorWindow.xaml
  138. +1 −1  silverlight/3.3.0.1/PubnubSilverlight.Example/Views/ErrorWindow.xaml.cs
  139. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/App.g.cs
  140. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/App.g.i.cs
  141. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  142. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  143. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Dialogs/PublishMessageDialog.g.cs
  144. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Dialogs/PublishMessageDialog.g.i.cs
  145. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/MainView.g.cs
  146. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/MainView.g.i.cs
  147. +74 −0 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.csproj.FileListAbsolute.txt
  148. BIN  .../3.3.0.1/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.csprojResolveAssemblyReference.cache
  149. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.dll
  150. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.g.resources
  151. BIN  silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/PubnubSilverlight.Example.pdb
  152. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/CodeExampleView.g.cs
  153. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/CodeExampleView.g.i.cs
  154. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/CodeUnitTestView.g.cs
  155. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/CodeUnitTestView.g.i.cs
  156. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/ErrorWindow.g.cs
  157. +2 −2 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/Views/ErrorWindow.g.i.cs
  158. +8 −10 silverlight/3.3.0.1/PubnubSilverlight.Example/obj/Debug/XapCacheFile.xml
  159. +4 −0 silverlight/3.3.0.1/PubnubSilverlight.Example/packages.config
  160. BIN  silverlight/3.3.0.1/PubnubSilverlight.Imports/Bin/Debug/PubnubSilverlight.Imports.dll
  161. BIN  silverlight/3.3.0.1/PubnubSilverlight.Imports/Bin/Debug/PubnubSilverlight.Imports.pdb
  162. +0 −35 silverlight/3.3.0.1/PubnubSilverlight.Imports/Properties/AssemblyInfo.cs
  163. +0 −87 silverlight/3.3.0.1/PubnubSilverlight.Imports/PubnubSilverlight.Imports.csproj
  164. +0 −29 silverlight/3.3.0.1/PubnubSilverlight.Imports/PubnubSilverlight.Imports.csproj.user
  165. BIN  silverlight/3.3.0.1/PubnubSilverlight.Imports/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  166. +0 −23 silverlight/3.3.0.1/PubnubSilverlight.Imports/obj/Debug/PubnubSilverlight.Imports.csproj.FileListAbsolute.txt
  167. BIN  silverlight/3.3.0.1/PubnubSilverlight.Imports/obj/Debug/PubnubSilverlight.Imports.dll
  168. BIN  silverlight/3.3.0.1/PubnubSilverlight.Imports/obj/Debug/PubnubSilverlight.Imports.pdb
  169. 0  .../3.3.0.1/PubnubSilverlight.Imports/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
  170. 0  .../3.3.0.1/PubnubSilverlight.Imports/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
  171. 0  .../3.3.0.1/PubnubSilverlight.Imports/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
  172. +0 −11 silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/AppManifest.xaml
  173. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/ConcurrentHashtable_Silverlight.dll
  174. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/Microsoft.Silverlight.Testing.dll
  175. BIN  ....3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll
  176. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/Newtonsoft.Json.dll
  177. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.Core.dll
  178. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.Core.pdb
  179. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.Imports.dll
  180. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.Imports.pdb
  181. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.UnitTest.dll
  182. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.UnitTest.pdb
  183. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/PubnubSilverlight.UnitTest.xap
  184. +0 −73 silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Bin/Debug/TestPage.html
  185. +0 −7 silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Properties/AppManifest.xml
  186. +0 −37 silverlight/3.3.0.1/PubnubSilverlight.UnitTest/Properties/AssemblyInfo.cs
  187. +0 −129 silverlight/3.3.0.1/PubnubSilverlight.UnitTest/PubnubSilverlight.UnitTest.csproj
  188. +0 −32 silverlight/3.3.0.1/PubnubSilverlight.UnitTest/PubnubSilverlight.UnitTest.csproj.user
  189. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/DesignTimeResolveAssemblyReferences.cache
  190. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
  191. +0 −66 ...erlight/3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/PubnubSilverlight.UnitTest.csproj.FileListAbsolute.txt
  192. BIN  ....3.0.1/PubnubSilverlight.UnitTest/obj/Debug/PubnubSilverlight.UnitTest.csprojResolveAssemblyReference.cache
  193. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/PubnubSilverlight.UnitTest.dll
  194. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/PubnubSilverlight.UnitTest.pdb
  195. BIN  silverlight/3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/ResolveAssemblyReference.cache
  196. 0  ...3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
  197. 0  ...3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
  198. 0  ...3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
  199. +0 −10 silverlight/3.3.0.1/PubnubSilverlight.UnitTest/obj/Debug/XapCacheFile.xml
  200. +0 −157 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-01 22_18_10.trx
  201. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-01 22_18_10/Out/PubNub-Messaging.Tests.pdb
  202. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-01 22_18_10/Out/PubNub-Messaging.exe
  203. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-01 22_18_10/Out/PubNub-Messaging.pdb
  204. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-01 22_18_10/Out/pubnub-messaging.tests.dll
  205. +0 −157 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_13_23.trx
  206. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_13_23/Out/PubNub-Messaging.Tests.pdb
  207. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_13_23/Out/PubNub-Messaging.exe
  208. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_13_23/Out/PubNub-Messaging.pdb
  209. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_13_23/Out/pubnub-messaging.tests.dll
  210. +0 −157 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_14_07.trx
  211. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_14_07/Out/PubNub-Messaging.Tests.pdb
  212. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_14_07/Out/PubNub-Messaging.exe
  213. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_14_07/Out/PubNub-Messaging.pdb
  214. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 21_14_07/Out/pubnub-messaging.tests.dll
  215. +0 −157 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 22_25_39.trx
  216. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 22_25_39/Out/PubNub-Messaging.Tests.pdb
  217. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 22_25_39/Out/PubNub-Messaging.exe
  218. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 22_25_39/Out/PubNub-Messaging.pdb
  219. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 22_25_39/Out/pubnub-messaging.tests.dll
  220. +0 −116 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 23_07_47.trx
  221. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 23_07_47/Out/AgentRestart.dat
  222. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 23_07_47/Out/PubNub-Messaging.Tests.pdb
  223. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 23_07_47/Out/PubNub-Messaging.exe
  224. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 23_07_47/Out/PubNub-Messaging.pdb
  225. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-03 23_07_47/Out/pubnub-messaging.tests.dll
  226. +0 −39 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_09_32.trx
  227. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_09_32/Out/AgentRestart.dat
  228. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_09_32/Out/PubNub-Messaging.Tests.pdb
  229. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_09_32/Out/PubNub-Messaging.exe
  230. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_09_32/Out/PubNub-Messaging.pdb
  231. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_09_32/Out/pubnub-messaging.tests.dll
  232. +0 −41 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_10_33.trx
  233. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_10_33/Out/PubNub-Messaging.Tests.pdb
  234. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_10_33/Out/PubNub-Messaging.exe
  235. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_10_33/Out/PubNub-Messaging.pdb
  236. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_10_33/Out/pubnub-messaging.tests.dll
  237. +0 −39 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_12_00.trx
  238. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_12_00/Out/AgentRestart.dat
  239. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_12_00/Out/PubNub-Messaging.Tests.pdb
  240. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_12_00/Out/PubNub-Messaging.exe
  241. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_12_00/Out/PubNub-Messaging.pdb
  242. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_12_00/Out/pubnub-messaging.tests.dll
  243. +0 −39 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_15_55.trx
  244. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_15_55/Out/AgentRestart.dat
  245. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_15_55/Out/PubNub-Messaging.Tests.pdb
  246. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_15_55/Out/PubNub-Messaging.exe
  247. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_15_55/Out/PubNub-Messaging.pdb
  248. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-04 18_15_55/Out/pubnub-messaging.tests.dll
  249. +0 −333 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-16 21_30_02.trx
  250. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-16 21_30_02/Out/Newtonsoft.Json.dll
  251. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-16 21_30_02/Out/PubNub-Messaging.Tests.pdb
  252. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-16 21_30_02/Out/PubNub-Messaging.exe
  253. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-16 21_30_02/Out/PubNub-Messaging.pdb
  254. +0 −11 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-16 21_30_02/Out/pubnub-messaging.log
  255. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-16 21_30_02/Out/pubnub-messaging.tests.dll
  256. +0 −22 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-16 21_30_02/Out/pubnub-messaging.tests.dll.config
  257. +0 −207 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_01_22.trx
  258. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_01_22/Out/Newtonsoft.Json.dll
  259. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_01_22/Out/PubNub-Messaging.Tests.pdb
  260. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_01_22/Out/PubNub-Messaging.exe
  261. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_01_22/Out/PubNub-Messaging.pdb
  262. +0 −1  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_01_22/Out/pubnub-messaging.log
  263. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_01_22/Out/pubnub-messaging.tests.dll
  264. +0 −22 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_01_22/Out/pubnub-messaging.tests.dll.config
  265. +0 −201 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_58_05.trx
  266. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_58_05/Out/AgentRestart.dat
  267. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_58_05/Out/Newtonsoft.Json.dll
  268. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_58_05/Out/PubNub-Messaging.Tests.pdb
  269. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_58_05/Out/PubNub-Messaging.exe
  270. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_58_05/Out/PubNub-Messaging.pdb
  271. +0 −1  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_58_05/Out/pubnub-messaging.log
  272. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_58_05/Out/pubnub-messaging.tests.dll
  273. +0 −22 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 00_58_05/Out/pubnub-messaging.tests.dll.config
  274. +0 −35 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_13_35.trx
  275. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_13_35/Out/Newtonsoft.Json.dll
  276. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_13_35/Out/PubNub-Messaging.Tests.pdb
  277. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_13_35/Out/PubNub-Messaging.exe
  278. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_13_35/Out/PubNub-Messaging.pdb
  279. +0 −1  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_13_35/Out/pubnub-messaging.log
  280. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_13_35/Out/pubnub-messaging.tests.dll
  281. +0 −22 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_13_35/Out/pubnub-messaging.tests.dll.config
  282. +0 −40 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_14_01.trx
  283. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_14_01/Out/AgentRestart.dat
  284. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_14_01/Out/Newtonsoft.Json.dll
  285. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_14_01/Out/PubNub-Messaging.Tests.pdb
  286. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_14_01/Out/PubNub-Messaging.exe
  287. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_14_01/Out/PubNub-Messaging.pdb
  288. +0 −1  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_14_01/Out/pubnub-messaging.log
  289. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_14_01/Out/pubnub-messaging.tests.dll
  290. +0 −22 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_14_01/Out/pubnub-messaging.tests.dll.config
  291. +0 −40 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_21_43.trx
  292. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_21_43/Out/AgentRestart.dat
  293. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_21_43/Out/Newtonsoft.Json.dll
  294. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_21_43/Out/PubNub-Messaging.Tests.pdb
  295. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_21_43/Out/PubNub-Messaging.exe
  296. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_21_43/Out/PubNub-Messaging.pdb
  297. +0 −1  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_21_43/Out/pubnub-messaging.log
  298. BIN  silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_21_43/Out/pubnub-messaging.tests.dll
  299. +0 −22 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_21_43/Out/pubnub-messaging.tests.dll.config
  300. +0 −40 silverlight/3.3.0.1/TestResults/Jhonny_JHONNY-PC 2012-11-17 01_22_18.trx
Sorry, we could not display the entire diff because too many files (383) changed.
View
22 silverlight/3.3.0.1/PubNub-Messaging.Tests/App.config
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
- </startup>
- <appSettings>
- <add key="OverrideTcpKeepAlive" value="false"/>
- </appSettings>
- <system.diagnostics>
- <trace autoflush="true" indentsize="4">
- <listeners>
- <add name="pubnubListener"
- type="System.Diagnostics.TextWriterTraceListener"
- initializeData="pubnub-messaging.log"/>
- <remove name="Default" />
- </listeners>
- </trace>
- <switches>
- <add name="PubnubTraceSwitch" value="1" />
- </switches>
- </system.diagnostics>
-</configuration>
View
526 silverlight/3.3.0.1/PubNub-Messaging.Tests/EncryptionTests.cs
@@ -1,526 +0,0 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.ComponentModel;
-using System.Threading;
-using System.Web.Script.Serialization;
-using System.Collections;
-using PubNub_Messaging;
-using System.Text.RegularExpressions;
-using System.Globalization;
-
-
-namespace PubNub_Messaging.Tests
-{
- /// <summary>
- /// Custom class for testing the encryption and decryption
- /// </summary>
- class CustomClass
- {
- public string foo = "hi!";
- public int[] bar = { 1, 2, 3, 4, 5 };
- }
- class SecretCustomClass
- {
- public string foo = "hello!";
- public int[] bar = { 10, 20, 30, 40, 50 };
- }
-
- [TestClass]
- public class EncryptionTests
- {
- /// <summary>
- /// Tests the null encryption.
- /// The input is serialized
- /// </summary>
- [TestMethod]
- [ExpectedException(typeof(ArgumentNullException))]
- public void TestNullEncryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //serialized string
- string strMessage = null;
-
- //encrypt
- string enc = pc.encrypt(strMessage);
- }
-
- /// <summary>
- /// Tests the null decryption.
- /// Assumes that the input message is deserialized
- /// </summary>
- [TestMethod]
- [ExpectedException(typeof(ArgumentNullException))]
- public void TestNullDecryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //deserialized string
- string strMessage = null;
- //decrypt
- string dec = pc.decrypt(strMessage);
-
- Assert.AreEqual("", dec);
- }
-
- /// <summary>
- /// Tests the yay decryption.
- /// Assumes that the input message is deserialized
- /// Decrypted string should match yay!
- /// </summary>
- [TestMethod]
- public void TestYayDecryptionBasic()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- string strMessage = "q/xJqqN6qbiZMXYmiQC1Fw==";
- //decrypt
- string dec = pc.decrypt(strMessage);
- //deserialize again
- Assert.AreEqual("yay!", dec);
- }
-
- /// <summary>
- /// Tests the yay encryption.
- /// The output is not serialized
- /// Encrypted string should match q/xJqqN6qbiZMXYmiQC1Fw==
- /// </summary>
- [TestMethod]
- public void TestYayEncryptionBasic()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //deserialized string
- string strMessage = "yay!";
- //Encrypt
- string enc = pc.encrypt(strMessage);
- Assert.AreEqual("q/xJqqN6qbiZMXYmiQC1Fw==", enc);
- }
-
- /// <summary>
- /// Tests the yay decryption.
- /// Assumes that the input message is not deserialized
- /// Decrypted and Deserialized string should match yay!
- /// </summary>
- [TestMethod]
- public void TestYayDecryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //string strMessage= "\"q/xJqqN6qbiZMXYmiQC1Fw==\"";
- //Non deserialized string
- string strMessage = "\"Wi24KS4pcTzvyuGOHubiXg==\"";
- //Deserialize
- JavaScriptSerializer js = new JavaScriptSerializer();
- strMessage = js.Deserialize<string>(strMessage);
- //decrypt
- string dec = pc.decrypt(strMessage);
- //deserialize again
- strMessage = js.Deserialize<string>(dec);
- Assert.AreEqual("yay!", strMessage);
- }
- /// <summary>
- /// Tests the yay encryption.
- /// The output is not serialized
- /// Encrypted string should match Wi24KS4pcTzvyuGOHubiXg==
- /// </summary>
- [TestMethod]
- public void TestYayEncryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //deserialized string
- string strMessage = "yay!";
- //serialize the string
- JavaScriptSerializer js = new JavaScriptSerializer();
- strMessage = js.Serialize(strMessage);
- Console.WriteLine(strMessage);
- //Encrypt
- string enc = pc.encrypt(strMessage);
- Assert.AreEqual("Wi24KS4pcTzvyuGOHubiXg==", enc);
- }
-
- /// <summary>
- /// Tests the array encryption.
- /// The output is not serialized
- /// Encrypted string should match the serialized object
- /// </summary>
- [TestMethod]
- public void TestArrayEncryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //create an empty array object
- object[] objArr = { };
- //serialize
- JavaScriptSerializer js = new JavaScriptSerializer();
- string strArr = js.Serialize(objArr);
- //Encrypt
- string enc = pc.encrypt(strArr);
-
- Assert.AreEqual("Ns4TB41JjT2NCXaGLWSPAQ==", enc);
- }
-
- /// <summary>
- /// Tests the array decryption.
- /// Assumes that the input message is deserialized
- /// And the output message has to been deserialized.
- /// Decrypted string should match the serialized object
- /// </summary>
- [TestMethod]
- public void TestArrayDecryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //Input the deserialized string
- string strMessage = "Ns4TB41JjT2NCXaGLWSPAQ==";
- //decrypt
- string dec = pc.decrypt(strMessage);
- //create a serialized object
- object[] objArr = { };
- JavaScriptSerializer js = new JavaScriptSerializer();
- string res = js.Serialize(objArr);
- //compare the serialized object and the return of the Decrypt method
- Assert.AreEqual(res, dec);
- }
-
- /// <summary>
- /// Tests the object encryption.
- /// The output is not serialized
- /// Encrypted string should match the serialized object
- /// </summary>
- [TestMethod]
- public void TestObjectEncryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //create an object
- Object obj = new Object();
- //serialize
- JavaScriptSerializer js = new JavaScriptSerializer();
- string strObj = js.Serialize(obj);
- //encrypt
- string enc = pc.encrypt(strObj);
-
- Assert.AreEqual("IDjZE9BHSjcX67RddfCYYg==", enc);
- }
- /// <summary>
- /// Tests the object decryption.
- /// Assumes that the input message is deserialized
- /// And the output message has to be deserialized.
- /// Decrypted string should match the serialized object
- /// </summary>
- [TestMethod]
- public void TestObjectDecryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //Deserialized
- string strMessage = "IDjZE9BHSjcX67RddfCYYg==";
- //Decrypt
- string dec = pc.decrypt(strMessage);
- //create an object
- Object obj = new Object();
- //Serialize the object
- JavaScriptSerializer js = new JavaScriptSerializer();
- string res = js.Serialize(obj);
-
- Assert.AreEqual(res, dec);
- }
- /// <summary>
- /// Tests my object encryption.
- /// The output is not serialized
- /// Encrypted string should match the serialized object
- /// </summary>
- [TestMethod]
- public void TestMyObjectEncryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //create an object of the custom class
- CustomClass cc = new CustomClass();
- //serialize it
- JavaScriptSerializer js = new JavaScriptSerializer();
- string res = js.Serialize(cc);
- //encrypt it
- string enc = pc.encrypt(res);
-
- Assert.AreEqual("Zbr7pEF/GFGKj1rOstp0tWzA4nwJXEfj+ezLtAr8qqE=", enc);
- }
- /// <summary>
- /// Tests my object decryption.
- /// The output is not deserialized
- /// Decrypted string should match the serialized object
- /// </summary>
- [TestMethod]
- public void TestMyObjectDecryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //Deserialized
- string strMessage = "Zbr7pEF/GFGKj1rOstp0tWzA4nwJXEfj+ezLtAr8qqE=";
- //Decrypt
- string dec = pc.decrypt(strMessage);
- //create an object of the custom class
- CustomClass cc = new CustomClass();
- JavaScriptSerializer js = new JavaScriptSerializer();
- //Serialize it
- string res = js.Serialize(cc);
-
- Assert.AreEqual(res, dec);
- }
-
- /// <summary>
- /// Tests the pub nub encryption2.
- /// The output is not serialized
- /// Encrypted string should match f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=
- /// </summary>
- [TestMethod]
- public void TestPubNubEncryption2()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //Deserialized
- string strMessage = "Pubnub Messaging API 2";
- //serialize the message
- JavaScriptSerializer js = new JavaScriptSerializer();
- strMessage = js.Serialize(strMessage);
- //encrypt
- string enc = pc.encrypt(strMessage);
-
- Assert.AreEqual("f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=", enc);
- }
-
- /// <summary>
- /// Tests the pub nub decryption2.
- /// Assumes that the input message is deserialized
- /// Decrypted and Deserialized string should match Pubnub Messaging API 2
- /// </summary>
- [TestMethod]
- public void TestPubNubDecryption2()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //Deserialized string
- string strMessage = "f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=";
- //Decrypt
- string dec = pc.decrypt(strMessage);
- //Deserialize
- JavaScriptSerializer js = new JavaScriptSerializer();
- strMessage = js.Deserialize<string>(dec);
- Assert.AreEqual("Pubnub Messaging API 2", strMessage);
- }
-
- /// <summary>
- /// Tests the pub nub encryption1.
- /// The input is not serialized
- /// Encrypted string should match f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=
- /// </summary>
- [TestMethod]
- public void TestPubNubEncryption1()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //non serialized string
- string strMessage = "Pubnub Messaging API 1";
- //serialize
- JavaScriptSerializer js = new JavaScriptSerializer();
- strMessage = js.Serialize(strMessage);
- //encrypt
- string enc = pc.encrypt(strMessage);
-
- Assert.AreEqual("f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=", enc);
- }
-
- /// <summary>
- /// Tests the pub nub decryption1.
- /// Assumes that the input message is deserialized
- /// Decrypted and Deserialized string should match Pubnub Messaging API 1
- /// </summary>
- [TestMethod]
- public void TestPubNubDecryption1()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //deserialized string
- string strMessage = "f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=";
- JavaScriptSerializer js = new JavaScriptSerializer();
- //decrypt
- string dec = pc.decrypt(strMessage);
- //deserialize
- strMessage = js.Deserialize<string>(dec);
- Assert.AreEqual("Pubnub Messaging API 1", strMessage);
- }
-
- /// <summary>
- /// Tests the stuff can encryption.
- /// The input is serialized
- /// Encrypted string should match zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF
- /// </summary>
- [TestMethod]
- public void TestStuffCanEncryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //input serialized string
- string strMessage = "{\"this stuff\":{\"can get\":\"complicated!\"}}";
- //encrypt
- string enc = pc.encrypt(strMessage);
-
- Assert.AreEqual("zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF", enc);
- }
-
- /// <summary>
- /// Tests the stuffcan decryption.
- /// Assumes that the input message is deserialized
- /// </summary>
- [TestMethod]
- public void TestStuffcanDecryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //deserialized string
- string strMessage = "zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF";
- //decrypt
- string dec = pc.decrypt(strMessage);
-
- Assert.AreEqual("{\"this stuff\":{\"can get\":\"complicated!\"}}", dec);
- }
-
- /// <summary>
- /// Tests the hash encryption.
- /// The input is serialized
- /// Encrypted string should match GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g=
- /// </summary>
- [TestMethod]
- public void TestHashEncryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //serialized string
- string strMessage = "{\"foo\":{\"bar\":\"foobar\"}}";
- //encrypt
- string enc = pc.encrypt(strMessage);
-
- Assert.AreEqual("GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g=", enc);
- }
-
- /// <summary>
- /// Tests the hash decryption.
- /// Assumes that the input message is deserialized
- /// </summary>
- [TestMethod]
- public void TestHashDecryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- //deserialized string
- string strMessage = "GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g=";
- //decrypt
- string dec = pc.decrypt(strMessage);
-
- Assert.AreEqual("{\"foo\":{\"bar\":\"foobar\"}}", dec);
- }
-
- /// <summary>
- /// Tests the unicode chars encryption.
- /// The input is not serialized
- /// </summary>
- [TestMethod]
- public void TestUnicodeCharsEncryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- string strMessage = "漢語";
-
- JavaScriptSerializer js = new JavaScriptSerializer();
- strMessage = js.Serialize(strMessage);
- Console.WriteLine(strMessage);
- string enc = pc.encrypt(strMessage);
- Console.WriteLine(enc);
- Assert.AreEqual("+BY5/miAA8aeuhVl4d13Kg==", enc);
- }
-
- /// <summary>
- /// Tests the unicode decryption.
- /// Assumes that the input message is deserialized
- /// Decrypted and Deserialized string should match the unicode chars
- /// </summary>
- [TestMethod]
- public void TestUnicodeCharsDecryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- string strMessage = "+BY5/miAA8aeuhVl4d13Kg==";
- JavaScriptSerializer js = new JavaScriptSerializer();
- //decrypt
- string dec = pc.decrypt(strMessage);
- //deserialize
- strMessage = js.Deserialize<string>(dec);
-
- Assert.AreEqual("漢語", strMessage);
- }
-
- /// <summary>
- /// Tests the german chars decryption.
- /// Assumes that the input message is deserialized
- /// Decrypted and Deserialized string should match the unicode chars
- /// </summary>
- [TestMethod]
- public void TestGermanCharsDecryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- string strMessage = "stpgsG1DZZxb44J7mFNSzg==";
- JavaScriptSerializer js = new JavaScriptSerializer();
- //decrypt
- string dec = pc.decrypt(strMessage);
- //deserialize
- strMessage = js.Deserialize<string>(dec);
-
- Assert.AreEqual("ÜÖ", strMessage);
- }
- /// <summary>
- /// Tests the german encryption.
- /// The input is not serialized
- /// </summary>
- [TestMethod]
- public void TestGermanCharsEncryption()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
- string strMessage = "ÜÖ";
-
- JavaScriptSerializer js = new JavaScriptSerializer();
- strMessage = js.Serialize(strMessage);
- Console.WriteLine(strMessage);
- string enc = pc.encrypt(strMessage);
- Console.WriteLine(enc);
- Assert.AreEqual("stpgsG1DZZxb44J7mFNSzg==", enc);
- }
-
- /// <summary>
- /// Tests the cipher.
- /// </summary>
- /*[TestMethod]
- public void TestCipher ()
- {
- PubnubCrypto pc = new PubnubCrypto("enigma");
-
- string strCipher = pc.GetEncryptionKey();
-
- Assert.AreEqual("67a4f45f0d1d9bc606486fc42dc49416", strCipher);
- }*/
-
- static string EncodeNonAsciiCharacters(string value)
- {
- StringBuilder sb = new StringBuilder();
- foreach (char c in value)
- {
- if (c > 127)
- {
- // This character is too big for ASCII
- string encodedValue = "\\u" + ((int)c).ToString("x4");
- sb.Append(encodedValue);
- }
- else
- {
- sb.Append(c);
- }
- }
- return sb.ToString();
- }
-
- static string DecodeEncodedNonAsciiCharacters(string value)
- {
- return Regex.Replace(
- value,
- @"\\u(?<Value>[a-zA-Z0-9]{4})",
- m =>
- {
- return ((char)int.Parse(m.Groups["Value"].Value, NumberStyles.HexNumber)).ToString();
- });
- }
-
-
- }
-}
View
35 silverlight/3.3.0.1/PubNub-Messaging.Tests/Properties/AssemblyInfo.cs
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("PubNub-Messaging.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("PubNub-Messaging.Tests")]
-[assembly: AssemblyCopyright("Copyright © 2012")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("761e42a6-a0fa-4896-9d27-e6cc4cef5e06")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
78 silverlight/3.3.0.1/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>
- </ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{9507724F-DEC3-452B-AC58-45A8DA05EC68}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>PubNub_Messaging.Tests</RootNamespace>
- <AssemblyName>PubNub-Messaging.Tests</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\PubNub-Messaging\bin\Debug\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Web.Extensions" />
- </ItemGroup>
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="EncryptionTests.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="WhenAClientIsPresented.cs" />
- <Compile Include="WhenAMessageIsPublished.cs" />
- <Compile Include="WhenDetailedHistoryIsRequested.cs" />
- <Compile Include="WhenGetRequestServerTime.cs" />
- <Compile Include="WhenSubscribedToAChannel.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\PubNub-Messaging\PubNub-Messaging.csproj">
- <Project>{B1ED98C3-FD0B-4B45-B0BE-40AFD37182CB}</Project>
- <Name>PubNub-Messaging</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="App.config" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
6 silverlight/3.3.0.1/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj.user
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectView>ShowAllFiles</ProjectView>
- </PropertyGroup>
-</Project>
View
119 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenAClientIsPresented.cs
@@ -1,119 +0,0 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.ComponentModel;
-using System.Threading;
-using System.Web.Script.Serialization;
-using System.Collections;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-
-namespace PubNub_Messaging.Tests
-{
- [TestClass]
- public class WhenAClientIsPresented
- {
- ManualResetEvent manualEvent1 = new ManualResetEvent(false);
- ManualResetEvent manualEvent2 = new ManualResetEvent(false);
- ManualResetEvent manualEvent3 = new ManualResetEvent(false);
-
- ManualResetEvent manualEvent4 = new ManualResetEvent(false);
-
- static bool receivedFlag1 = false;
- static bool receivedFlag2 = false;
-
- [TestMethod]
- public void ThenPresenceShouldReturnReceivedMessage()
- {
- receivedFlag1 = false;
-
- Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
- string channel = "my/channel";
-
- pubnub.presence<string>(channel, ThenPresenceShouldReturnMessage);
-
- //since presence expects from stimulus from sub/unsub...
- pubnub.subscribe<string>(channel, DummyMethodForSubscribe);
- manualEvent1.WaitOne(2000);
-
- pubnub.unsubscribe<string>(channel, DummyMethodForUnSubscribe);
- manualEvent3.WaitOne(2000);
-
- manualEvent2.WaitOne(310 * 1000);
- Assert.IsTrue(receivedFlag1, "Presence message not received");
- }
-
- void ThenPresenceShouldReturnMessage(string receivedMessage)
- {
- try
- {
- if (!string.IsNullOrWhiteSpace(receivedMessage))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(receivedMessage);
- JContainer dic = receivedObj[0] as JContainer;
- var uuid = dic["uuid"].ToString();
- if (uuid != null)
- {
- receivedFlag1 = true;
- }
- }
- }
- catch { }
- finally
- {
- manualEvent2.Set();
- }
- }
-
-
-
- [TestMethod]
- public void IfHereNowIsCalledThenItShouldReturnInfo()
- {
- receivedFlag2 = false;
-
- Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
- string channel = "my/channel";
- pubnub.here_now<string>(channel, ThenHereNowShouldReturnMessage);
- manualEvent4.WaitOne();
- Assert.IsTrue(receivedFlag2, "here_now message not received");
- }
-
- void ThenHereNowShouldReturnMessage(string receivedMessage)
- {
- try
- {
- if (!string.IsNullOrWhiteSpace(receivedMessage))
- {
- JavaScriptSerializer js = new JavaScriptSerializer();
- IList receivedObj = (IList)js.DeserializeObject(receivedMessage);
- var dic = ((IDictionary<string, object>)receivedObj[0])["uuids"];
- if (dic != null)
- {
- receivedFlag2 = true;
- }
- }
- }
- catch { }
- finally
- {
- manualEvent4.Set();
- }
- }
-
- void DummyMethodForSubscribe(string receivedMessage)
- {
- manualEvent1.Set();
- //Dummary callback method for subscribe and unsubscribe to test presence
- }
-
- void DummyMethodForUnSubscribe(string receivedMessage)
- {
- manualEvent3.Set();
- //Dummary callback method for unsubscribe to test presence
- }
- }
-}
View
444 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenAMessageIsPublished.cs
@@ -1,444 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.ComponentModel;
-using System.Threading;
-using System.Web.Script.Serialization;
-using System.Collections;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-namespace PubNub_Messaging.Tests
-{
- [TestClass]
- public class WhenAMessageIsPublished
- {
- ManualResetEvent manualEvent1 = new ManualResetEvent(false);
- ManualResetEvent manualEvent2 = new ManualResetEvent(false);
- ManualResetEvent manualEvent3 = new ManualResetEvent(false);
-
- ManualResetEvent mreUnencryptObjectPub = new ManualResetEvent(false);
- ManualResetEvent mreEncryptObjectPub = new ManualResetEvent(false);
- ManualResetEvent mreEncryptPub = new ManualResetEvent(false);
- ManualResetEvent mreSecretEncryptPub = new ManualResetEvent(false);
- ManualResetEvent mreEncryptDH = new ManualResetEvent(false);
- ManualResetEvent mreSecretEncryptDH = new ManualResetEvent(false);
- ManualResetEvent mreUnencryptDH = new ManualResetEvent(false);
- ManualResetEvent mreUnencryptObjectDH = new ManualResetEvent(false);
- ManualResetEvent mreEncryptObjectDH = new ManualResetEvent(false);
-
- bool isPublished2 = false;
- bool isPublished3 = false;
-
- bool isUnencryptPublished = false;
- bool isUnencryptObjectPublished = false;
- bool isEncryptObjectPublished = false;
- bool isUnencryptDH = false;
- bool isUnencryptObjectDH = false;
- bool isEncryptObjectDH = false;
- bool isEncryptPublished = false;
- bool isSecretEncryptPublished = false;
- bool isEncryptDH = false;
- bool isSecretEncryptDH = false;
-
- long unEncryptPublishTimetoken = 0;
- long unEncryptObjectPublishTimetoken = 0;
- long encryptObjectPublishTimetoken = 0;
- long encryptPublishTimetoken = 0;
- long secretEncryptPublishTimetoken = 0;
-
- const string messageForUnencryptPublish = "Pubnub Messaging API 1";
- const string messageForEncryptPublish = "漢語";
- const string messageForSecretEncryptPublish = "Pubnub Messaging API 2";
- string messageObjectForUnencryptPublish = "";
- string messageObjectForEncryptPublish = "";
-
- [TestMethod]
- public void ThenUnencryptPublishShouldReturnSuccessCodeAndInfo()
- {
- isUnencryptPublished = false;
- Pubnub pubnub = new Pubnub("demo","demo","","",false);
- string channel = "my/channel";
- string message = messageForUnencryptPublish;
-
- pubnub.publish<string>(channel, message, ReturnSuccessUnencryptPublishCodeCallback);
- manualEvent1.WaitOne(310*1000);
-
- if (!isUnencryptPublished)
- {
- Assert.IsTrue(isUnencryptPublished, "Unencrypt Publish Failed");
- }
- else
- {
- pubnub.detailedHistory<string>(channel, -1, unEncryptPublishTimetoken, -1, false, CaptureUnencryptDetailedHistoryCallback);
- mreUnencryptDH.WaitOne(310 * 1000);
- Assert.IsTrue(isUnencryptDH, "Unable to match the successful unencrypt Publish");
- }
- }
-
- [TestMethod]
- public void ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo()
- {
- isUnencryptObjectPublished = false;
- Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
- string channel = "my/channel";
- object message = new CustomClass();
- messageObjectForUnencryptPublish = JsonConvert.SerializeObject(message);
-
- pubnub.publish<string>(channel, message, ReturnSuccessUnencryptObjectPublishCodeCallback);
- mreUnencryptObjectPub.WaitOne(310 * 1000);
-
- if (!isUnencryptObjectPublished)
- {
- Assert.IsTrue(isUnencryptObjectPublished, "Unencrypt Publish Failed");
- }
- else
- {
- pubnub.detailedHistory<string>(channel, -1, unEncryptObjectPublishTimetoken, -1, false, CaptureUnencryptObjectDetailedHistoryCallback);
- mreUnencryptObjectDH.WaitOne(310 * 1000);
- Assert.IsTrue(isUnencryptObjectDH, "Unable to match the successful unencrypt object Publish");
- }
- }
-
- [TestMethod]
- public void ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo()
- {
- isEncryptObjectPublished = false;
- Pubnub pubnub = new Pubnub("demo", "demo", "", "enigma", false);
- string channel = "my/channel";
- object message = new SecretCustomClass();
- messageObjectForEncryptPublish = JsonConvert.SerializeObject(message);
-
- pubnub.publish<string>(channel, message, ReturnSuccessEncryptObjectPublishCodeCallback);
- mreEncryptObjectPub.WaitOne(310 * 1000);
-
- if (!isEncryptObjectPublished)
- {
- Assert.IsTrue(isEncryptObjectPublished, "Encrypt Object Publish Failed");
- }
- else
- {
- pubnub.detailedHistory<string>(channel, -1, encryptObjectPublishTimetoken, -1, false, CaptureEncryptObjectDetailedHistoryCallback);
- mreEncryptObjectDH.WaitOne(310 * 1000);
- Assert.IsTrue(isEncryptObjectDH, "Unable to match the successful encrypt object Publish");
- }
- }
-
- [TestMethod]
- public void ThenEncryptPublishShouldReturnSuccessCodeAndInfo()
- {
- isEncryptPublished = false;
- Pubnub pubnub = new Pubnub("demo", "demo", "", "enigma", false);
- string channel = "my/channel";
- string message = messageForEncryptPublish;
-
- pubnub.publish<string>(channel, message, ReturnSuccessEncryptPublishCodeCallback);
- mreEncryptPub.WaitOne(310 * 1000);
-
- if (!isEncryptPublished)
- {
- Assert.IsTrue(isEncryptPublished, "Encrypt Publish Failed");
- }
- else
- {
- pubnub.detailedHistory<string>(channel, -1, encryptPublishTimetoken, -1, false, CaptureEncryptDetailedHistoryCallback);
- mreEncryptDH.WaitOne(310 * 1000);
- Assert.IsTrue(isEncryptDH, "Unable to decrypt the successful Publish");
- }
- }
-
- [TestMethod]
- public void ThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo()
- {
- isSecretEncryptPublished = false;
- Pubnub pubnub = new Pubnub("demo", "demo", "key", "enigma", false);
- string channel = "my/channel";
- string message = messageForSecretEncryptPublish;
-
- pubnub.publish<string>(channel, message, ReturnSuccessSecretEncryptPublishCodeCallback);
- mreSecretEncryptPub.WaitOne(310 * 1000);
-
- if (!isSecretEncryptPublished)
- {
- Assert.IsTrue(isSecretEncryptPublished, "Secret Encrypt Publish Failed");
- }
- else
- {
- pubnub.detailedHistory<string>(channel, -1, secretEncryptPublishTimetoken, -1, false, CaptureSecretEncryptDetailedHistoryCallback);
- mreSecretEncryptDH.WaitOne(310 * 1000);
- Assert.IsTrue(isSecretEncryptDH, "Unable to decrypt the successful Secret key Publish");
- }
- }
-
- private void ReturnSuccessUnencryptPublishCodeCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- long statusCode = Int64.Parse(receivedObj[0].ToString());
- string statusMsg = (string)receivedObj[1];
- if (statusCode == 1 && statusMsg.ToLower() == "sent")
- {
- isUnencryptPublished = true;
- unEncryptPublishTimetoken = Convert.ToInt64(receivedObj[2].ToString());
- }
- }
- }
- manualEvent1.Set();
- }
-
- private void ReturnSuccessUnencryptObjectPublishCodeCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- long statusCode = Int64.Parse(receivedObj[0].ToString());
- string statusMsg = (string)receivedObj[1];
- if (statusCode == 1 && statusMsg.ToLower() == "sent")
- {
- isUnencryptObjectPublished = true;
- unEncryptObjectPublishTimetoken = Convert.ToInt64(receivedObj[2].ToString());
- }
- }
- }
- mreUnencryptObjectPub.Set();
- }
-
- private void ReturnSuccessEncryptObjectPublishCodeCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- long statusCode = Int64.Parse(receivedObj[0].ToString());
- string statusMsg = (string)receivedObj[1];
- if (statusCode == 1 && statusMsg.ToLower() == "sent")
- {
- isEncryptObjectPublished = true;
- encryptObjectPublishTimetoken = Convert.ToInt64(receivedObj[2].ToString());
- }
- }
- }
- mreEncryptObjectPub.Set();
- }
-
- private void ReturnSuccessEncryptPublishCodeCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- long statusCode = Int64.Parse(receivedObj[0].ToString());
- string statusMsg = (string)receivedObj[1];
- if (statusCode == 1 && statusMsg.ToLower() == "sent")
- {
- isEncryptPublished = true;
- encryptPublishTimetoken = Convert.ToInt64(receivedObj[2].ToString());
- }
- }
- }
- mreEncryptPub.Set();
- }
-
- private void ReturnSuccessSecretEncryptPublishCodeCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- long statusCode = Int64.Parse(receivedObj[0].ToString());
- string statusMsg = (string)receivedObj[1];
- if (statusCode == 1 && statusMsg.ToLower() == "sent")
- {
- isSecretEncryptPublished = true;
- secretEncryptPublishTimetoken = Convert.ToInt64(receivedObj[2].ToString());
- }
- }
- }
- mreSecretEncryptPub.Set();
- }
-
- private void CaptureUnencryptDetailedHistoryCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- JArray jObj = JArray.Parse(receivedObj[0].ToString());
- if (jObj[0].ToString() == messageForUnencryptPublish)
- {
- isUnencryptDH = true;
- }
- }
- }
-
- mreUnencryptDH.Set();
- }
-
- private void CaptureUnencryptObjectDetailedHistoryCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- JArray jArr = JArray.Parse(receivedObj[0].ToString());
- if (jArr[0].ToString(Formatting.None) == messageObjectForUnencryptPublish)
- {
- isUnencryptObjectDH = true;
- }
- }
- }
-
- mreUnencryptObjectDH.Set();
- }
-
- private void CaptureEncryptObjectDetailedHistoryCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- JArray jArr = JArray.Parse(receivedObj[0].ToString());
- if (jArr[0].ToString(Formatting.None) == messageObjectForEncryptPublish)
- {
- isEncryptObjectDH = true;
- }
- }
- }
-
- mreEncryptObjectDH.Set();
- }
-
- private void CaptureEncryptDetailedHistoryCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- JArray jArr = JArray.Parse(receivedObj[0].ToString());
- if (jArr[0].ToString() == messageForEncryptPublish)
- {
- isEncryptDH = true;
- }
- }
- }
-
- mreEncryptDH.Set();
- }
-
- private void CaptureSecretEncryptDetailedHistoryCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- JArray jArr = JArray.Parse(receivedObj[0].ToString());
- if (jArr[0].ToString() == messageForSecretEncryptPublish)
- {
- isSecretEncryptDH = true;
- }
- }
- }
-
- mreSecretEncryptDH.Set();
- }
-
- [TestMethod]
- public void ThenPubnubShouldGenerateUniqueIdentifier()
- {
- Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
-
- Assert.IsNotNull(pubnub.generateGUID());
- }
-
- [TestMethod]
- [ExpectedException(typeof(MissingFieldException))]
- public void ThenPublishKeyShouldNotBeEmpty()
- {
- Pubnub pubnub = new Pubnub("", "demo", "", "", false);
-
- string channel = "my/channel";
- string message = "Pubnub API Usage Example";
-
- pubnub.publish<string>(channel, message, null);
- }
-
-
- [TestMethod]
- public void ThenOptionalSecretKeyShouldBeProvidedInConstructor()
- {
- isPublished2 = false;
- Pubnub pubnub = new Pubnub("demo","demo","key");
- string channel = "my/channel";
- string message = "Pubnub API Usage Example";
-
- pubnub.publish<string>(channel, message, ReturnSecretKeyPublishCallback);
- manualEvent2.WaitOne(310 * 1000);
-
- Assert.IsTrue(isPublished2, "Publish Failed with secret key");
- }
-
- private void ReturnSecretKeyPublishCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- long statusCode = Int64.Parse(receivedObj[0].ToString());
- string statusMsg = (string)receivedObj[1];
- if (statusCode == 1 && statusMsg.ToLower() == "sent")
- {
- isPublished2 = true;
- }
- }
- }
- manualEvent2.Set();
- }
-
- [TestMethod]
- public void IfSSLNotProvidedThenDefaultShouldBeFalse()
- {
- isPublished3 = false;
- Pubnub pubnub = new Pubnub("demo", "demo", "");
- string channel = "my/channel";
- string message = "Pubnub API Usage Example";
-
- pubnub.publish<string>(channel, message, ReturnNoSSLDefaultFalseCallback);
- manualEvent3.WaitOne(310 * 1000);
- Assert.IsTrue(isPublished3, "Publish Failed with no SSL");
- }
-
- private void ReturnNoSSLDefaultFalseCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(result);
- if (receivedObj is object[])
- {
- long statusCode = Int64.Parse(receivedObj[0].ToString());
- string statusMsg = (string)receivedObj[1];
- if (statusCode == 1 && statusMsg.ToLower() == "sent")
- {
- isPublished3 = true;
- }
- }
- }
- manualEvent3.Set();
- }
- }
-}
View
174 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenDetailedHistoryIsRequested.cs
@@ -1,174 +0,0 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.ComponentModel;
-using System.Threading;
-using System.Web.Script.Serialization;
-using System.Collections;
-
-
-namespace PubNub_Messaging.Tests
-{
- [TestClass]
- public class WhenDetailedHistoryIsRequested
- {
- ManualResetEvent mreMsgCount10 = new ManualResetEvent(false);
- ManualResetEvent mreMsgCount10ReverseTrue = new ManualResetEvent(false);
- ManualResetEvent mreMsgStartReverseTrue = new ManualResetEvent(false);
- ManualResetEvent mrePublishStartReverseTrue = new ManualResetEvent(false);
-
-
- bool msg10Received = false;
- bool msg10ReverseTrueReceived = false;
- bool msgStartReverseTrue = false;
-
- int expectedCountAtStartTimeWithReverseTrue=0;
- long startTimeWithReverseTrue = 0;
-
- [TestMethod]
- public void DetailHistoryCount10ReturnsRecords()
- {
- msg10Received = false;
-
- Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
- string channel = "my/channel";
-
- pubnub.detailedHistory<string>(channel, 10, DetailedHistoryCount10Callback);
- mreMsgCount10.WaitOne(310 * 1000);
- Assert.IsTrue(msg10Received, "Detailed History Failed");
- }
-
- void DetailedHistoryCount10Callback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- JavaScriptSerializer js = new JavaScriptSerializer();
- IList receivedObj = (IList)js.DeserializeObject(result);
- if (receivedObj is object[])
- {
- if (receivedObj[0] is object[])
- {
- object[] historyObj = (object[])receivedObj[0];
- if (historyObj.Length >= 0)
- {
- msg10Received = true;
- }
- }
- }
- }
-
- mreMsgCount10.Set();
- }
-
- [TestMethod]
- public void DetailHistoryCount10ReverseTrueReturnsRecords()
- {
- msg10ReverseTrueReceived = false;
-
- Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
- string channel = "my/channel";
-
- pubnub.detailedHistory<string>(channel, -1, -1, 10, true, DetailedHistoryCount10ReverseTrueCallback);
- mreMsgCount10ReverseTrue.WaitOne(310 * 1000);
- Assert.IsTrue(msg10ReverseTrueReceived, "Detailed History Failed");
- }
-
- void DetailedHistoryCount10ReverseTrueCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- JavaScriptSerializer js = new JavaScriptSerializer();
- IList receivedObj = (IList)js.DeserializeObject(result);
- if (receivedObj is object[])
- {
- if (receivedObj[0] is object[])
- {
- object[] historyObj = (object[])receivedObj[0];
- if (historyObj.Length >= 0)
- {
- msg10ReverseTrueReceived = true;
- }
- }
- }
- }
-
- mreMsgCount10ReverseTrue.Set();
- }
-
- [TestMethod]
- public void DetailedHistoryStartWithReverseTrue()
- {
- expectedCountAtStartTimeWithReverseTrue = 0;
- msgStartReverseTrue = false;
- Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
- string channel = "my/channel";
- startTimeWithReverseTrue = Pubnub.translateDateTimeToPubnubUnixNanoSeconds(DateTime.UtcNow);
- for (int index = 0; index < 10; index++)
- {
- pubnub.publish<string>(channel,
- string.Format("DetailedHistoryStartTimeWithReverseTrue {0} {1}", startTimeWithReverseTrue, index),
- DetailedHistorySamplePublishCallback);
- mrePublishStartReverseTrue.WaitOne(5000);
- }
-
- Thread.Sleep(5000);
-
- pubnub.detailedHistory<string>(channel, startTimeWithReverseTrue, DetailedHistoryStartWithReverseTrueCallback, true);
- mreMsgStartReverseTrue.WaitOne(310 * 1000);
- Assert.IsTrue(msgStartReverseTrue, "Detailed History with Start and Reverse True Failed");
- }
-
- private void DetailedHistoryStartWithReverseTrueCallback(string result)
- {
- int actualCountAtStartTimeWithReverseFalse = 0;
- if (!string.IsNullOrWhiteSpace(result))
- {
- JavaScriptSerializer js = new JavaScriptSerializer();
- IList receivedObj = (IList)js.DeserializeObject(result);
- if (receivedObj is object[])
- {
- if (receivedObj[0] is object[])
- {
- object[] historyObj = (object[])receivedObj[0];
- if (historyObj.Length >= expectedCountAtStartTimeWithReverseTrue)
- {
- foreach (object item in historyObj)
- {
- if (item.ToString().Contains(string.Format("DetailedHistoryStartTimeWithReverseTrue {0}", startTimeWithReverseTrue)))
- {
- actualCountAtStartTimeWithReverseFalse++;
- }
- }
- if (actualCountAtStartTimeWithReverseFalse == expectedCountAtStartTimeWithReverseTrue)
- {
- msgStartReverseTrue = true;
- }
- }
- }
- }
- }
- mreMsgStartReverseTrue.Set();
- }
-
- private void DetailedHistorySamplePublishCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- JavaScriptSerializer js = new JavaScriptSerializer();
- IList receivedObj = (IList)js.DeserializeObject(result);
- if (receivedObj is object[])
- {
- int statusCode = (int)receivedObj[0];
- string statusMsg = (string)receivedObj[1];
- if (statusCode == 1 && statusMsg.ToLower() == "sent")
- {
- expectedCountAtStartTimeWithReverseTrue++;
- }
- }
- }
- mrePublishStartReverseTrue.Set();
- }
- }
-}
View
64 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenGetRequestServerTime.cs
@@ -1,64 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.ComponentModel;
-using System.Threading;
-using System.Web.Script.Serialization;
-using System.Collections;
-
-namespace PubNub_Messaging.Tests
-{
- [TestClass]
- public class WhenGetRequestServerTime
- {
- ManualResetEvent manualEvent1 = new ManualResetEvent(false);
- bool timeReceived = false;
-
- [TestMethod]
- public void ThenItShouldReturnTimeStamp()
- {
- Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
- pubnub.time<string>(ReturnTimeStampCallback);
- manualEvent1.WaitOne(310 * 1000);
- Assert.IsTrue(timeReceived, "time() Failed");
- }
-
- private void ReturnTimeStampCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- JavaScriptSerializer js = new JavaScriptSerializer();
- IList receivedObj = (IList)js.DeserializeObject(result);
- if (receivedObj is object[])
- {
- string time = receivedObj[0].ToString();
- if (time.Length > 0)
- {
- timeReceived = true;
- }
- }
- }
- manualEvent1.Set();
- }
-
- [TestMethod]
- public void TranslateDateTimeToUnixTime()
- {
- //Test for 26th June 2012 GMT
- DateTime dt = new DateTime(2012,6,26,0,0,0,DateTimeKind.Utc);
- long nanosecTime = Pubnub.translateDateTimeToPubnubUnixNanoSeconds(dt);
- Assert.AreEqual<long>(13406688000000000, nanosecTime);
- }
-
- [TestMethod]
- public void TranslateUnixTimeToDateTime()
- {
- //Test for 26th June 2012 GMT
- DateTime expectedDt = new DateTime(2012, 6, 26, 0, 0, 0, DateTimeKind.Utc);
- DateTime actualDt = Pubnub.translatePubnubUnixNanoSecondsToDateTime(13406688000000000);
- Assert.AreEqual<DateTime>(expectedDt, actualDt);
- }
- }
-}
View
63 silverlight/3.3.0.1/PubNub-Messaging.Tests/WhenSubscribedToAChannel.cs
@@ -1,63 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.ComponentModel;
-using System.Threading;
-using System.Web.Script.Serialization;
-using System.Collections;
-
-namespace PubNub_Messaging.Tests
-{
- [TestClass]
- public class WhenSubscribedToAChannel
- {
- ManualResetEvent manualEvent1 = new ManualResetEvent(false);
- ManualResetEvent manualEvent2 = new ManualResetEvent(false);
-
- bool receivedMessage = false;
-
- [TestMethod]
- public void ThenSubscribeShouldReturnReceivedMessage()
- {
- receivedMessage = false;
- Pubnub pubnub = new Pubnub("demo","demo","","",false);
-
- string channel = "my/channel";
-
- pubnub.subscribe<string>(channel, ReceivedMessageCallback);
- Thread.Sleep(5000);
-
- pubnub.publish<string>(channel, "Test for WhenSubscribedToAChannel ThenItShouldReturnReceivedMessage", dummyPublishCallback);
- manualEvent2.WaitOne(310 * 1000);
-
- manualEvent1.WaitOne(310*1000);
- Assert.IsTrue(receivedMessage,"WhenSubscribedToAChannel --> ThenItShouldReturnReceivedMessage Failed");
- }
-
- private void ReceivedMessageCallback(string result)
- {
- if (!string.IsNullOrWhiteSpace(result))
- {
- JavaScriptSerializer js = new JavaScriptSerializer();
- IList receivedObj = (IList)js.DeserializeObject(result);
- if (receivedObj is object[])
- {
- object subscribedObj = (object)receivedObj[0];
- if (subscribedObj != null)
- {
- receivedMessage = true;
- }
- }
- }
- manualEvent1.Set();
- }
-
- private void dummyPublishCallback(string result)
- {
- manualEvent2.Set();
- }
-
- }
-}
View
BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/Newtonsoft.Json.dll
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.dll
Binary file not shown
View
22 silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.dll.config
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
- </startup>
- <appSettings>
- <add key="OverrideTcpKeepAlive" value="false"/>
- </appSettings>
- <system.diagnostics>
- <trace autoflush="true" indentsize="4">
- <listeners>
- <add name="pubnubListener"
- type="System.Diagnostics.TextWriterTraceListener"
- initializeData="pubnub-messaging.log"/>
- <remove name="Default" />
- </listeners>
- </trace>
- <switches>
- <add name="PubnubTraceSwitch" value="1" />
- </switches>
- </system.diagnostics>
-</configuration>
View
BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.Tests.pdb
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.exe
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/bin/Debug/PubNub-Messaging.pdb
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown
View
29 silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.csproj.FileListAbsolute.txt
@@ -1,29 +0,0 @@
-C:\Users\Jhonny\Documents\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.Tests.dll.config
-C:\Users\Jhonny\Documents\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.Tests.dll
-C:\Users\Jhonny\Documents\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.Tests.pdb
-C:\Users\Jhonny\Documents\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\Newtonsoft.Json.dll
-C:\Users\Jhonny\Documents\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.exe
-C:\Users\Jhonny\Documents\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.pdb
-C:\Users\Jhonny\Documents\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\obj\Debug\PubNub-Messaging.Tests.csprojResolveAssemblyReference.cache
-C:\Users\Jhonny\Documents\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\obj\Debug\PubNub-Messaging.Tests.dll
-C:\Users\Jhonny\Documents\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\obj\Debug\PubNub-Messaging.Tests.pdb
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.Tests.dll.config
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.Tests.dll
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.Tests.pdb
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\Newtonsoft.Json.dll
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.exe
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.pdb
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\Newtonsoft.Json.pdb
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\Newtonsoft.Json.xml
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\obj\Debug\PubNub-Messaging.Tests.csprojResolveAssemblyReference.cache
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\obj\Debug\PubNub-Messaging.Tests.dll
-C:\Pandu\GitHub\pubnub-api\silverlight-part\PubNub-Messaging.Tests\obj\Debug\PubNub-Messaging.Tests.pdb
-E:\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.Tests.dll.config
-E:\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.Tests.dll
-E:\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.Tests.pdb
-E:\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\Newtonsoft.Json.dll
-E:\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.exe
-E:\pubnub-api\silverlight-part\PubNub-Messaging.Tests\bin\Debug\PubNub-Messaging.pdb
-E:\pubnub-api\silverlight-part\PubNub-Messaging.Tests\obj\Debug\PubNub-Messaging.Tests.csprojResolveAssemblyReference.cache
-E:\pubnub-api\silverlight-part\PubNub-Messaging.Tests\obj\Debug\PubNub-Messaging.Tests.dll
-E:\pubnub-api\silverlight-part\PubNub-Messaging.Tests\obj\Debug\PubNub-Messaging.Tests.pdb
View
BIN  ...ght/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.csprojResolveAssemblyReference.cache
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.dll
Binary file not shown
View
BIN  silverlight/3.3.0.1/PubNub-Messaging.Tests/obj/Debug/PubNub-Messaging.Tests.pdb
Binary file not shown
View
82 silverlight/3.3.0.1/PubNub-Messaging/DetailedHistory_Example.cs
@@ -1,82 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace PubNub_Messaging
-{
- internal static class DetailedHistory_Example
- {
- public static void Main()
- {
- DetailedHistoryCountDemo();
- Console.ReadLine();
- }
-
- internal static void DetailedHistoryCountDemo()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false);
-
- string channel = "my_channel";
-
- //Console.WriteLine("Detailed History Count Demo");
- //pubnub.detailedHistory(channel, 100, DisplayDetailedHistory);
-
- //Console.WriteLine("Detailed History Count and reverse Demo");
- //pubnub.detailedHistory(channel, -1, -1, 100, true, DisplayDetailedHistory);
-
- //Console.WriteLine("Detailed History with start and end");
- //pubnub.detailedHistory(channel, 13499635513028988, 13499836911845528, 200, true, DisplayDetailedHistory);
-
- //Console.WriteLine("Detailed History with start");
- //pubnub.detailedHistory(channel, 13499635513028988, -1, 100, true, DisplayDetailedHistory);
-
- Console.WriteLine("Detailed History with end");
- pubnub.detailedHistory(channel, -1, 13499836911845528, 100, true, DisplayDetailedHistory);
- }
-
- static void DisplayDetailedHistory(object result)
- {
- try
- {
- IList<object> msg = result as IList<object>;
- if (msg != null && msg.Count > 0)
- {
- object[] history = msg[0] as object[];
- if (history != null && history.Length > 0)
- {
- Console.WriteLine(string.Format("Total history records = {0}", history.Length));
- foreach (object item in history)
- {
- if (!item.GetType().IsGenericType)
- {
- Console.WriteLine(item.ToString());
- }
- else if ((item.GetType().IsGenericType) && (item.GetType().Name == typeof(Dictionary<,>).Name))
- {
- Dictionary<string, object> itemList = (Dictionary<string, object>)item;
- foreach (KeyValuePair<string, object> pair in itemList)
- {
- Console.WriteLine(string.Format("Key = {0}; Value = {1}", pair.Key, pair.Value));
- }
- }
- else
- {
- Console.WriteLine(string.Format("Unhandled type {0}",item.ToString()));
- }
- }
- }
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- }
-}
View
39 silverlight/3.3.0.1/PubNub-Messaging/Here_Now_Example.cs
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace PubNub_Messaging
-{
- internal static class Here_Now_Example
- {
- public static void Main()
- {
- Here_Now_Demo();
- Console.ReadLine();
- }
-
- internal static void Here_Now_Demo()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false);
-
- string channel = "my/channel";
-
- Console.WriteLine("Here_Now_Example");
-
- pubnub.here_now<string>(channel, DisplayReturnMessage);
-
- }
-
- static void DisplayReturnMessage(string result )
- {
- Console.WriteLine(result);
- }
-
- }
-}
View
74 silverlight/3.3.0.1/PubNub-Messaging/PresenceUnsubscribe_Example.cs
@@ -1,74 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace PubNub_Messaging
-{
- internal class PresenceUnsubscribe_Example
- {
- internal static void PresenceUnsubscribeDemo()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false);
-
- string channel = "my_channel";
-
- Console.WriteLine("PresenceUnsubscribe_Example");
-
- pubnub.presence_unsubscribe(channel, DisplayPresenceUnpresenceReturnMessage);
-
- }
-
- static void DisplayPresenceUnpresenceReturnMessage(object result)
- {
- IList<object> message = result as IList<object>;
-
- if (message != null && message.Count >= 2)
- {
- for(int index=0; index < message.Count; index++)
- {
- Console.WriteLine(string.Format("[{0}] = {1}",index, message[index].ToString()));
- object[] msg = message[0] as object[];
- if (msg != null)
- {
- foreach (object item in msg)
- {
- if (item is Dictionary<string, object>)
- {
- Dictionary<string, object> itemList = (Dictionary<string, object>)item;
- foreach (KeyValuePair<string, object> pair in itemList)
- {
- Console.WriteLine(string.Format("Key = {0}; Value = {1}", pair.Key, pair.Value));
- }
- }
- else if (item is object[])
- {
- object[] itemList = (object[])item;
- foreach (string innerItem in itemList)
- {
- Console.WriteLine(innerItem.ToString());
- }
- }
- else
- {
- Console.WriteLine(item.ToString());
- }
- }
- }
- }
- Console.WriteLine(string.Format("Channel = {0}", message[2].ToString()));
-
- }
- else
- {
- Console.WriteLine("result is not List<object>");
- }
- }
-
- }
-}
View
157 silverlight/3.3.0.1/PubNub-Messaging/Presence_Example.cs
@@ -1,157 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace PubNub_Messaging
-{
- internal static class Presence_Example
- {
- internal static void PresenceDemo()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false);
-
- string channel = "my_channel";
-
- Console.WriteLine("Presence_Example");
-
- pubnub.presence(channel, DisplayReturnMessage);
-
- bool pre_unsub = false;
- while (!pre_unsub)
- {
- Console.WriteLine("Enter y for Presence-Unsub; x to EXIT presence loop");
- string userchoice = Console.ReadLine();
- if (userchoice.ToLower() == "y")
- {
- Console.WriteLine("PresenceUnsubscribe_Example");
- pubnub.presence_unsubscribe(channel, DisplayReturnMessage);
-
- pre_unsub = true;
- }
- else if (userchoice.ToLower() == "x")
- {
- pre_unsub = true;
- }
- }
-
-
- }
-
- static void DisplayReturnMessage(object result)
- {
- IList<object> message = result as IList<object>;
-
- if (message != null && message.Count >= 2)
- {
- for (int index = 0; index < message.Count; index++)
- {
- ParseObject(message[index], 1);
- }
- }
- else
- {
- Console.WriteLine("unable to parse data");
- }
- }
-
- static void ParseObject(object result, int loop)
- {
- if (result is object[])
- {
- object[] arrResult = (object[])result;
- foreach (object item in arrResult)
- {
- if (!item.GetType().IsGenericType)
- {
- if (!item.GetType().IsArray)
- {
- Console.WriteLine(item.ToString());
- }
- else
- {
- ParseObject(item, loop + 1);
- }
- }
- else
- {
- ParseObject(item, loop + 1);
- }
- }
- }
- else if (result.GetType().IsGenericType && (result.GetType().Name == typeof(Dictionary<,>).Name))
- {
- Dictionary<string, object> itemList = (Dictionary<string, object>)result;
- foreach (KeyValuePair<string, object> pair in itemList)
- {
- Console.WriteLine(string.Format("key = {0}", pair.Key));
- if (pair.Value is object[])
- {
- Console.WriteLine("value = ");
- ParseObject(pair.Value, loop);
- }
- else
- {
- Console.WriteLine(string.Format("value = {0}", pair.Value));
- }
- }
- }
-
- }
-
- //static void DisplayReturnMessage(object result)
- //{
- // IList<object> message = result as IList<object>;
-
- // if (message != null && message.Count >= 2)
- // {
- // for (int index = 0; index < message.Count; index++)
- // {
- // if (!message[index].GetType().IsGenericType)
- // {
- // if (message[index] is object[])
- // {
- // object[] itemList = (object[])message[index];
- // for (int itemIndex = 0; itemIndex < itemList.Length; itemIndex++)
- // {
- // if (!itemList[itemIndex].GetType().IsGenericType)
- // {
- // Console.WriteLine(string.Format("[{0}][{1}] = {2}", index, itemIndex, itemList[itemIndex].ToString()));
- // }
- // else if ((itemList[itemIndex].GetType().IsGenericType) && (itemList[itemIndex].GetType().Name == typeof(Dictionary<,>).Name))
- // {
- // Dictionary<string, object> subitemList = (Dictionary<string, object>)itemList[itemIndex];
- // foreach (KeyValuePair<string, object> pair in subitemList)
- // {
- // Console.WriteLine(string.Format("[{0}][{1}] = {2}", index, pair.Key, pair.Value));
- // }
- // }
- // }
- // }
- // else
- // {
- // Console.WriteLine(string.Format("[{0}] = {1}", index, message[index].ToString()));
- // }
- // }