Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding new files

  • Loading branch information...
commit 0861503c23b6926156252360124f3c51cf5f461f 1 parent 59e3e80
geremy cohen authored
Showing with 44,422 additions and 0 deletions.
  1. +19 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/App.xaml
  2. +143 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/App.xaml.cs
  3. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/ApplicationIcon.png
  4. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Background.png
  5. +45 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/MainPage.xaml
  6. +39 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/MainPage.xaml.cs
  7. +6 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Properties/AppManifest.xml
  8. +37 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Properties/AssemblyInfo.cs
  9. +35 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Properties/WMAppManifest.xml
  10. +142 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/PubnubWindowsPhone.Test.csproj
  11. +15 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/PubnubWindowsPhone.Test.csproj.user
  12. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/SplashScreenImage.jpg
  13. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Cancel.png
  14. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Check.png
  15. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Delete.png
  16. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Email.png
  17. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Play.png
  18. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Save.png
  19. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Select.png
  20. +34 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/CustomClass.cs
  21. +686 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/EncryptionTests.cs
  22. +397 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/PubnubUnitTest.cs
  23. +163 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenAClientIsPresented.cs
  24. +608 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenAMessageIsPublished.cs
  25. +219 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenDetailedHistoryIsRequested.cs
  26. +91 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenGetRequestServerTime.cs
  27. +153 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenSubscribedToAChannel.cs
  28. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/WP71/Microsoft.Phone.Controls.Toolkit.dll
  29. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/WP71/Microsoft.Phone.Toolkit.Testing.dll
  30. BIN  ...indows-phone/3.3.0.1/PubnubWindowsPhone.Test/WP71/Microsoft.VisualStudio.QualityTools.UnitTesting.Phone.dll
  31. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/WP71/Newtonsoft.Json.dll
  32. +50 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.sln
  33. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.suo
  34. +19 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/App.xaml
  35. +144 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/App.xaml.cs
  36. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/ApplicationIcon.png
  37. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/Background.png
  38. +29 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/MainPage.cs
  39. +45 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/MainPage.xaml
  40. +27 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/MainPage.xaml.cs
  41. +6 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/Properties/AppManifest.xml
  42. +37 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/Properties/AssemblyInfo.cs
  43. +35 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/Properties/WMAppManifest.xml
  44. +19 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PublishMessageUserControl.xaml
  45. +22 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PublishMessageUserControl.xaml.cs
  46. +3,408 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/Pubnub.cs
  47. +63 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PubnubDemoStart.xaml
  48. +35 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PubnubDemoStart.xaml.cs
  49. +59 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PubnubOperation.xaml
  50. +186 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PubnubOperation.xaml.cs
  51. +135 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PubnubWindowsPhone.csproj
  52. +15 −0 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PubnubWindowsPhone.csproj.user
  53. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PubnubWindowsPhone.suo
  54. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/SplashScreenImage.jpg
  55. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/WP71/Newtonsoft.Json.dll
  56. +2 −0  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/WP71/Notes.txt
  57. BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/WP71/System.Threading.Tasks.WP71.dll
  58. +23 −0 csharp-windows-phone/3.3.0.1/README.txt
  59. +396 −0 csharp/3.1/Pubnub.cs
  60. BIN  csharp/3.1/Pubnub.exe
  61. BIN  csharp/3.1/Pubnub.exe.mdb
  62. +400 −0 csharp/3.1/Pubnub2.cs
  63. +1,007 −0 csharp/3.1/PubnubAsync.cs
  64. +392 −0 csharp/3.1/PubnubCustomer.cs
  65. BIN  csharp/3.1/PubnubCustomer.exe
  66. BIN  csharp/3.1/PubnubCustomer.exe.mdb
  67. BIN  csharp/3.1/System.Runtime.Serialization.Json.dll
  68. +65 −0 csharp/3.1/System.Runtime.Serialization.Json.xml
  69. BIN  csharp/3.1/System.Web.Extensions.dll
  70. +10,600 −0 csharp/3.1/System.Web.Extensions.xml
  71. +8 −0 csharp/3.1/customer-api-build
  72. +8 −0 csharp/3.1/mono-build
  73. +7 −0 csharp/3.1/mono-build-asyc
  74. +7 −0 csharp/3.1/mono-build-async
  75. +35 −0 csharp/3.2/PubNub-Messaging.Tests/Properties/AssemblyInfo.cs
  76. +77 −0 csharp/3.2/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj
  77. +58 −0 csharp/3.2/PubNub-Messaging.Tests/WhenAClientIsPresented.cs
  78. +119 −0 csharp/3.2/PubNub-Messaging.Tests/WhenAMessageIsPublished.cs
  79. +39 −0 csharp/3.2/PubNub-Messaging.Tests/WhenGetRequestHistoryMessage.cs
  80. +33 −0 csharp/3.2/PubNub-Messaging.Tests/WhenGetRequestServerTime.cs
  81. +38 −0 csharp/3.2/PubNub-Messaging.Tests/WhenSubscribedToAChannel.cs
  82. +103 −0 csharp/3.2/PubNub-Messaging/PubNub-Messaging.csproj
  83. +13 −0 csharp/3.2/PubNub-Messaging/PubNub-Messaging.csproj.user
  84. +1,167 −0 csharp/3.2/PubNub-Messaging/Pubnub.cs
  85. +201 −0 csharp/3.2/PubNub-Messaging/Pubnub_Example.cs
  86. +3 −0  csharp/3.2/PubNub-Messaging/app.config
  87. +54 −0 csharp/3.2/PubNub.sln
  88. BIN  csharp/3.2/PubNub.suo
  89. +1 −0  csharp/3.3.0.1/.gitignore
  90. BIN  csharp/3.3.0.1/NugetPkg/Pubnub.3.3.0.1-release-01-02-13-5.nupkg
  91. BIN  csharp/3.3.0.1/NugetPkg/Pubnub.3.3.0.1-release-12-17-12-1.nupkg
  92. +16 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/App.config
  93. +512 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/EncryptionTests.cs
  94. +36 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/Properties/AssemblyInfo.cs
  95. +118 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj
  96. +16 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj.user
  97. +374 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/PubnubUnitTest.cs
  98. +137 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenAClientIsPresented.cs
  99. +495 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenAMessageIsPublished.cs
  100. +193 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenDetailedHistoryIsRequested.cs
  101. +72 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenGetRequestServerTime.cs
  102. +128 −0 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenSubscribedToAChannel.cs
  103. BIN  csharp/3.3.0.1/PubNub-Messaging.Tests/v3.5/Newtonsoft.Json.dll
  104. BIN  csharp/3.3.0.1/PubNub-Messaging.Tests/v4.0/Newtonsoft.Json.dll
  105. +182 −0 csharp/3.3.0.1/PubNub-Messaging/PubNub-Messaging.csproj
  106. +14 −0 csharp/3.3.0.1/PubNub-Messaging/PubNub-Messaging.csproj.user
  107. +3,408 −0 csharp/3.3.0.1/PubNub-Messaging/Pubnub.cs
  108. +184 −0 csharp/3.3.0.1/PubNub-Messaging/Pubnub_Example.cs
  109. +15 −0 csharp/3.3.0.1/PubNub-Messaging/app.config
  110. BIN  csharp/3.3.0.1/PubNub-Messaging/v3.5/Newtonsoft.Json.dll
  111. +1 −0  csharp/3.3.0.1/PubNub-Messaging/v3.5/Notes.txt
  112. BIN  csharp/3.3.0.1/PubNub-Messaging/v3.5/System.Threading.dll
  113. BIN  csharp/3.3.0.1/PubNub-Messaging/v4.0/Newtonsoft.Json.dll
  114. +44 −0 csharp/3.3.0.1/PubNub.sln
  115. BIN  csharp/3.3.0.1/PubNub.suo
  116. +35 −0 csharp/3.3/PubNub-Messaging.Tests/Properties/AssemblyInfo.cs
  117. +78 −0 csharp/3.3/PubNub-Messaging.Tests/PubNub-Messaging.Tests.csproj
  118. +60 −0 csharp/3.3/PubNub-Messaging.Tests/WhenAClientIsPresented.cs
  119. +123 −0 csharp/3.3/PubNub-Messaging.Tests/WhenAMessageIsPublished.cs
  120. +42 −0 csharp/3.3/PubNub-Messaging.Tests/WhenDetailedHistoryIsRequested.cs
  121. +40 −0 csharp/3.3/PubNub-Messaging.Tests/WhenGetRequestHistoryMessage.cs
  122. +34 −0 csharp/3.3/PubNub-Messaging.Tests/WhenGetRequestServerTime.cs
  123. +39 −0 csharp/3.3/PubNub-Messaging.Tests/WhenSubscribedToAChannel.cs
  124. +103 −0 csharp/3.3/PubNub-Messaging/PubNub-Messaging.csproj
  125. +13 −0 csharp/3.3/PubNub-Messaging/PubNub-Messaging.csproj.user
  126. +1,254 −0 csharp/3.3/PubNub-Messaging/Pubnub.cs
  127. +486 −0 csharp/3.3/PubNub-Messaging/Pubnub_Example.cs
  128. +3 −0  csharp/3.3/PubNub-Messaging/app.config
  129. +42 −0 csharp/3.3/PubNub.sln
  130. BIN  csharp/3.3/PubNub.suo
  131. +32 −0 csharp/README.md
  132. +5 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/.gitignore
  133. +38 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit.sln
  134. +137 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Andr.Unit.csproj
  135. +19 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Assets/AboutAssets.txt
  136. +110 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Common.cs
  137. +510 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/EncryptionTests.cs
  138. +49 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/MainActivity.cs
  139. +6 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Properties/AndroidManifest.xml
  140. +27 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Properties/AssemblyInfo.cs
  141. +505 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/PubnubUnitTest.cs
  142. +44 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Resources/AboutResources.txt
  143. +151 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Resources/Resource.designer.cs
  144. BIN  mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Resources/drawable/Icon.png
  145. +14 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Resources/layout/Main.axml
  146. +5 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Resources/values/Strings.xml
  147. +160 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenAClientIsPresented.cs
  148. +177 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenAMessageIsPublished.cs
  149. +1,074 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenDetailedHistoryIsRequested.cs
  150. +142 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenGetRequestHistoryMessages.cs
  151. +47 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenGetRequestServerTime.cs
  152. +125 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenSubscribedToAChannel.cs
  153. +45 −0 ...ndroid/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Activities/CreditsActivity.cs
  154. +72 −0 ...ndroid/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Activities/OptionsActivity.cs
  155. +138 −0 ...android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Activities/RunnerActivity.cs
  156. +56 −0 ...oid/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Activities/TestResultActivity.cs
  157. +87 −0 ...roid/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Activities/TestSuiteActivity.cs
  158. +185 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/AndroidRunner.cs
  159. +46 −0 ...or-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Elements/ActionElement.cs
  160. +48 −0 ...-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Elements/ActivityElement.cs
  161. +77 −0 ...android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Elements/FormattedElement.cs
  162. +53 −0 ...android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Elements/FormattedSection.cs
  163. +81 −0 ...-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Elements/TestCaseElement.cs
  164. +58 −0 ...-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Elements/TestElement.cs
  165. +88 −0 ...android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/Elements/TestSuiteElement.cs
  166. +60 −0 ...or-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/AssemblyInfo.cs
  167. +155 −0 ...ubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/AttributeConstraints.cs
  168. +136 −0 ....1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/BasicConstraints.cs
  169. +165 −0 ....1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/BinaryOperations.cs
  170. +625 −0 ...bnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/CollectionConstraints.cs
  171. +173 −0 ...1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ComparisonAdapter.cs
  172. +190 −0 ...bnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ComparisonConstraints.cs
  173. +309 −0 .../3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/Constraint.cs
  174. +286 −0 ...1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ConstraintBuilder.cs
  175. +771 −0 ...ubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ConstraintExpression.cs
  176. +118 −0 ...b-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ConstraintExpressionBase.cs
  177. +772 −0 ...1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ConstraintFactory.cs
  178. +497 −0 ...Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ConstraintOperators.cs
  179. +104 −0 .../Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ContainsConstraint.cs
  180. +68 −0 ...0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/EmptyConstraint.cs
  181. +526 −0 ...0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/EqualConstraint.cs
  182. +137 −0 ...0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/EqualityAdapter.cs
  183. +255 −0 ...bnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/FloatingPointNumerics.cs
  184. +38 −0 .../Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/IResolveConstraint.cs
  185. +154 −0 ...3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/MessageWriter.cs
  186. +283 −0 ...id/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/MsgUtils.cs
  187. +84 −0 ...3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/NUnitComparer.cs
  188. +319 −0 ...bnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/NUnitEqualityComparer.cs
  189. +380 −0 ...id/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/Numerics.cs
  190. +240 −0 ...0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/PathConstraints.cs
  191. +72 −0 ...Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/PredicateConstraint.cs
  192. +243 −0 ...1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/PrefixConstraints.cs
  193. +185 −0 .../Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/PropertyConstraint.cs
  194. +109 −0 ...0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/RangeConstraint.cs
  195. +79 −0 ...aging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ResolvableConstraintExpression.cs
  196. +72 −0 ....1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/SameAsConstraint.cs
  197. +187 −0 ...ub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/SerializableConstraints.cs
  198. +327 −0 ...1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/StringConstraints.cs
  199. +184 −0 ....1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/ThrowsConstraint.cs
  200. +242 −0 ...d/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/Tolerance.cs
  201. +200 −0 ...0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Constraints/TypeConstraints.cs
  202. +40 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Env.cs
  203. +506 −0 ...ndroid/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Framework/Assert.cs
  204. +61 −0 ....1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Framework/AssertionException.cs
  205. +273 −0 ...3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Framework/AssertionHelper.cs
  206. +25 −0 ...roid/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Framework/Contains.cs
  207. +42 −0 .../Pubnub-Messaging/Andr.Unit-master/Android.NUnitLite/AndrRunner/NUnitLite/Framework/DescriptionAttribute.cs
Sorry, we could not display the entire diff because too many files (1,123) changed.
View
19 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/App.xaml
@@ -0,0 +1,19 @@
+<Application
+ x:Class="PubnubWindowsPhone.Test.App"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
+
+ <!--Application Resources-->
+ <Application.Resources>
+ </Application.Resources>
+
+ <Application.ApplicationLifetimeObjects>
+ <!--Required object that handles lifetime events for the application-->
+ <shell:PhoneApplicationService
+ Launching="Application_Launching" Closing="Application_Closing"
+ Activated="Application_Activated" Deactivated="Application_Deactivated"/>
+ </Application.ApplicationLifetimeObjects>
+
+</Application>
View
143 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/App.xaml.cs
@@ -0,0 +1,143 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Microsoft.Phone.Controls;
+using Microsoft.Phone.Shell;
+
+namespace PubnubWindowsPhone.Test
+{
+ public partial class App : Application
+ {
+ /// <summary>
+ /// Provides easy access to the root frame of the Phone Application.
+ /// </summary>
+ /// <returns>The root frame of the Phone Application.</returns>
+ public PhoneApplicationFrame RootFrame { get; private set; }
+
+ /// <summary>
+ /// Constructor for the Application object.
+ /// </summary>
+ public App()
+ {
+ // Global handler for uncaught exceptions.
+ UnhandledException += Application_UnhandledException;
+
+ // Standard Silverlight initialization
+ InitializeComponent();
+
+ // Phone-specific initialization
+ InitializePhoneApplication();
+
+ // Show graphics profiling information while debugging.
+ if (System.Diagnostics.Debugger.IsAttached)
+ {
+ // Display the current frame rate counters.
+ Application.Current.Host.Settings.EnableFrameRateCounter = true;
+
+ // Show the areas of the app that are being redrawn in each frame.
+ //Application.Current.Host.Settings.EnableRedrawRegions = true;
+
+ // Enable non-production analysis visualization mode,
+ // which shows areas of a page that are handed off to GPU with a colored overlay.
+ //Application.Current.Host.Settings.EnableCacheVisualization = true;
+
+ // Disable the application idle detection by setting the UserIdleDetectionMode property of the
+ // application's PhoneApplicationService object to Disabled.
+ // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
+ // and consume battery power when the user is not using the phone.
+ PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
+ }
+
+ }
+
+ // Code to execute when the application is launching (eg, from Start)
+ // This code will not execute when the application is reactivated
+ private void Application_Launching(object sender, LaunchingEventArgs e)
+ {
+
+ }
+
+ // Code to execute when the application is activated (brought to foreground)
+ // This code will not execute when the application is first launched
+ private void Application_Activated(object sender, ActivatedEventArgs e)
+ {
+ }
+
+ // Code to execute when the application is deactivated (sent to background)
+ // This code will not execute when the application is closing
+ private void Application_Deactivated(object sender, DeactivatedEventArgs e)
+ {
+ }
+
+ // Code to execute when the application is closing (eg, user hit Back)
+ // This code will not execute when the application is deactivated
+ private void Application_Closing(object sender, ClosingEventArgs e)
+ {
+ }
+
+ // Code to execute if a navigation fails
+ private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ if (System.Diagnostics.Debugger.IsAttached)
+ {
+ // A navigation has failed; break into the debugger
+ System.Diagnostics.Debugger.Break();
+ }
+ }
+
+ // Code to execute on Unhandled Exceptions
+ private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+ {
+ if (System.Diagnostics.Debugger.IsAttached)
+ {
+ // An unhandled exception has occurred; break into the debugger
+ System.Diagnostics.Debugger.Break();
+ }
+ }
+
+ #region Phone application initialization
+
+ // Avoid double-initialization
+ private bool phoneApplicationInitialized = false;
+
+ // Do not add any additional code to this method
+ private void InitializePhoneApplication()
+ {
+ if (phoneApplicationInitialized)
+ return;
+
+ // Create the frame but don't set it as RootVisual yet; this allows the splash
+ // screen to remain active until the application is ready to render.
+ RootFrame = new PhoneApplicationFrame();
+ RootFrame.Navigated += CompleteInitializePhoneApplication;
+
+ // Handle navigation failures
+ RootFrame.NavigationFailed += RootFrame_NavigationFailed;
+
+ // Ensure we don't initialize again
+ phoneApplicationInitialized = true;
+ }
+
+ // Do not add any additional code to this method
+ private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
+ {
+ // Set the root visual to allow the application to render
+ if (RootVisual != RootFrame)
+ RootVisual = RootFrame;
+
+ // Remove this handler since it is no longer needed
+ RootFrame.Navigated -= CompleteInitializePhoneApplication;
+ }
+
+ #endregion
+ }
+}
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/ApplicationIcon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
45 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/MainPage.xaml
@@ -0,0 +1,45 @@
+<phone:PhoneApplicationPage
+ x:Class="PubnubWindowsPhone.Test.MainPage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+ xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
+ FontFamily="{StaticResource PhoneFontFamilyNormal}"
+ FontSize="{StaticResource PhoneFontSizeNormal}"
+ Foreground="{StaticResource PhoneForegroundBrush}"
+ SupportedOrientations="Portrait" Orientation="Portrait"
+ shell:SystemTray.IsVisible="True">
+
+ <!--LayoutRoot is the root grid where all page content is placed-->
+ <Grid x:Name="LayoutRoot" Background="Transparent">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ </Grid.RowDefinitions>
+
+ <!--TitlePanel contains the name of the application and page title-->
+ <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
+ <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
+ <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
+ </StackPanel>
+
+ <!--ContentPanel - place additional content here-->
+ <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"></Grid>
+ </Grid>
+
+ <!--Sample code showing usage of ApplicationBar-->
+ <!--<phone:PhoneApplicationPage.ApplicationBar>
+ <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
+ <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
+ <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
+ <shell:ApplicationBar.MenuItems>
+ <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
+ <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
+ </shell:ApplicationBar.MenuItems>
+ </shell:ApplicationBar>
+ </phone:PhoneApplicationPage.ApplicationBar>-->
+
+</phone:PhoneApplicationPage>
View
39 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/MainPage.xaml.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+using Microsoft.Phone.Controls;
+
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.Phone.Testing;
+
+
+namespace PubnubWindowsPhone.Test
+{
+ public partial class MainPage : PhoneApplicationPage
+ {
+ // Constructor
+ public MainPage()
+ {
+ InitializeComponent();
+
+ const bool runUnitTests = true;
+
+ if (runUnitTests)
+ {
+ Content = UnitTestSystem.CreateTestPage();
+ }
+
+ }
+
+ }
+
+
+}
View
6 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Properties/AppManifest.xml
@@ -0,0 +1,6 @@
+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+ <Deployment.Parts>
+ </Deployment.Parts>
+</Deployment>
View
37 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Properties/AssemblyInfo.cs
@@ -0,0 +1,37 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+// 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("PubnubWindowsPhone.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("PubnubWindowsPhone.Test")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 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("d8e3c1cf-26dd-4dea-9f8f-5ee15978d33e")]
+
+// 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 Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: NeutralResourcesLanguageAttribute("en-US")]
View
35 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Properties/WMAppManifest.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" AppPlatformVersion="7.1">
+ <App xmlns="" ProductID="{25ad395c-8ad4-4f79-8bee-b7a3351ca259}" Title="PubnubWindowsPhone.Test" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="PubnubWindowsPhone.Test author" Description="Sample description" Publisher="PubnubWindowsPhone.Test">
+ <IconPath IsRelative="true" IsResource="false">ApplicationIcon.png</IconPath>
+ <Capabilities>
+ <Capability Name="ID_CAP_GAMERSERVICES"/>
+ <Capability Name="ID_CAP_IDENTITY_DEVICE"/>
+ <Capability Name="ID_CAP_IDENTITY_USER"/>
+ <Capability Name="ID_CAP_LOCATION"/>
+ <Capability Name="ID_CAP_MEDIALIB"/>
+ <Capability Name="ID_CAP_MICROPHONE"/>
+ <Capability Name="ID_CAP_NETWORKING"/>
+ <Capability Name="ID_CAP_PHONEDIALER"/>
+ <Capability Name="ID_CAP_PUSH_NOTIFICATION"/>
+ <Capability Name="ID_CAP_SENSORS"/>
+ <Capability Name="ID_CAP_WEBBROWSERCOMPONENT"/>
+ <Capability Name="ID_CAP_ISV_CAMERA"/>
+ <Capability Name="ID_CAP_CONTACTS"/>
+ <Capability Name="ID_CAP_APPOINTMENTS"/>
+ </Capabilities>
+ <Tasks>
+ <DefaultTask Name ="_default" NavigationPage="MainPage.xaml"/>
+ </Tasks>
+ <Tokens>
+ <PrimaryToken TokenID="PubnubWindowsPhone.TestToken" TaskName="_default">
+ <TemplateType5>
+ <BackgroundImageURI IsRelative="true" IsResource="false">Background.png</BackgroundImageURI>
+ <Count>0</Count>
+ <Title>PubnubWindowsPhone.Test</Title>
+ </TemplateType5>
+ </PrimaryToken>
+ </Tokens>
+ </App>
+</Deployment>
View
142 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/PubnubWindowsPhone.Test.csproj
@@ -0,0 +1,142 @@
+<?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>10.0.20506</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{9B519CB9-2E72-45DA-A9D5-B76C59BBE017}</ProjectGuid>
+ <ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>PubnubWindowsPhone.Test</RootNamespace>
+ <AssemblyName>PubnubWindowsPhone.Test</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+ <TargetFrameworkProfile>WindowsPhone71</TargetFrameworkProfile>
+ <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+ <SilverlightApplication>true</SilverlightApplication>
+ <SupportedCultures>
+ </SupportedCultures>
+ <XapOutputs>true</XapOutputs>
+ <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+ <XapFilename>PubnubWindowsPhone.Test.xap</XapFilename>
+ <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+ <SilverlightAppEntry>PubnubWindowsPhone.Test.App</SilverlightAppEntry>
+ <ValidateXaml>true</ValidateXaml>
+ <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>Bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <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;SILVERLIGHT;WINDOWS_PHONE</DefineConstants>
+ <NoStdLib>true</NoStdLib>
+ <NoConfig>true</NoConfig>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Phone" />
+ <Reference Include="Microsoft.Phone.Controls.Toolkit">
+ <HintPath>WP71\Microsoft.Phone.Controls.Toolkit.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Phone.Interop" />
+ <Reference Include="Microsoft.Phone.Toolkit.Testing">
+ <HintPath>WP71\Microsoft.Phone.Toolkit.Testing.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Phone">
+ <HintPath>WP71\Microsoft.VisualStudio.QualityTools.UnitTesting.Phone.dll</HintPath>
+ </Reference>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>WP71\Newtonsoft.Json.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.Servicemodel.Web" />
+ <Reference Include="System.Windows" />
+ <Reference Include="system" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Xml" />
+ <Reference Include="mscorlib.extensions" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainPage.xaml.cs">
+ <DependentUpon>MainPage.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="UnitTest\CustomClass.cs" />
+ <Compile Include="UnitTest\EncryptionTests.cs" />
+ <Compile Include="UnitTest\PubnubUnitTest.cs" />
+ <Compile Include="UnitTest\WhenAClientIsPresented.cs" />
+ <Compile Include="UnitTest\WhenAMessageIsPublished.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="UnitTest\WhenDetailedHistoryIsRequested.cs" />
+ <Compile Include="UnitTest\WhenGetRequestServerTime.cs" />
+ <Compile Include="UnitTest\WhenSubscribedToAChannel.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </ApplicationDefinition>
+ <Page Include="MainPage.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\AppManifest.xml" />
+ <None Include="Properties\WMAppManifest.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="ApplicationIcon.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="Background.png">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="SplashScreenImage.jpg" />
+ <Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />
+ <Content Include="Toolkit.Content\ApplicationBar.Check.png" />
+ <Content Include="Toolkit.Content\ApplicationBar.Delete.png" />
+ <Content Include="Toolkit.Content\ApplicationBar.Email.png" />
+ <Content Include="Toolkit.Content\ApplicationBar.Play.png" />
+ <Content Include="Toolkit.Content\ApplicationBar.Save.png" />
+ <Content Include="Toolkit.Content\ApplicationBar.Select.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\PubnubWindowsPhone\PubnubWindowsPhone.csproj">
+ <Project>{282DA561-8612-4382-B34B-F8BC7BFB212C}</Project>
+ <Name>PubnubWindowsPhone</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="WP71\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
+ <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.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>
+ -->
+ <ProjectExtensions />
+</Project>
View
15 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/PubnubWindowsPhone.Test.csproj.user
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectView>ShowAllFiles</ProjectView>
+ </PropertyGroup>
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{C089C8C0-30E0-4E22-80C0-CE093F111A43}">
+ <SilverlightMobileCSProjectFlavor>
+ <FullDeploy>False</FullDeploy>
+ </SilverlightMobileCSProjectFlavor>
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project>
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/SplashScreenImage.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Cancel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Check.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Delete.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Email.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Play.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Save.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/Toolkit.Content/ApplicationBar.Select.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
34 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/CustomClass.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+using System.Runtime.Serialization.Json;
+using Newtonsoft.Json;
+
+
+namespace PubnubWindowsPhone.Test.UnitTest
+{
+ /// <summary>
+ /// Custom class for testing the encryption and decryption
+ /// </summary>
+ public class CustomClass
+ {
+ public string foo = "hi!";
+ public int[] bar = { 1, 2, 3, 4, 5 };
+ }
+
+ //[Seri
+ public class SecretCustomClass
+ {
+ public string foo = "hello!";
+
+ public int[] bar = { 10, 20, 30, 40, 50 };
+ }
+}
View
686 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/EncryptionTests.cs
@@ -0,0 +1,686 @@
+using System;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.Phone.Testing;
+using PubNub_Messaging;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System.Threading;
+using System.Collections.Generic;
+
+using System.Globalization;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace PubnubWindowsPhone.Test.UnitTest
+{
+
+ [TestClass]
+ public class EncryptionTests:WorkItemTest
+ {
+ /// <summary>
+ /// Tests the null encryption.
+ /// The input is serialized
+ /// </summary>
+ [TestMethod,Asynchronous]
+ public void TestNullEncryption()
+ {
+
+ bool isExpectedException = false;
+
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //serialized string
+ string strMessage = null;
+
+ try
+ {
+ //encrypt
+ string enc = pc.encrypt(strMessage);
+ }
+ catch (ArgumentNullException)
+ {
+ isExpectedException = true;
+ }
+
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.IsTrue(isExpectedException);
+ TestComplete();
+ });
+
+ });
+ }
+
+ /// <summary>
+ /// Tests the null decryption.
+ /// Assumes that the input message is deserialized
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestNullDecryption()
+ {
+ bool isExpectedException = false;
+ string dec = "";
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //deserialized string
+ string strMessage = null;
+ try
+ {
+ //decrypt
+ dec = pc.decrypt(strMessage);
+ }
+ catch (ArgumentNullException)
+ {
+ isExpectedException = true;
+ }
+
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ //Assert.AreEqual("", dec);
+ Assert.IsTrue(isExpectedException);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the yay decryption.
+ /// Assumes that the input message is deserialized
+ /// Decrypted string should match yay!
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestYayDecryptionBasic()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ string strMessage = "q/xJqqN6qbiZMXYmiQC1Fw==";
+ //decrypt
+ string dec = pc.decrypt(strMessage);
+ //deserialize again
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("yay!", dec);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the yay encryption.
+ /// The output is not serialized
+ /// Encrypted string should match q/xJqqN6qbiZMXYmiQC1Fw==
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestYayEncryptionBasic()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //deserialized string
+ string strMessage = "yay!";
+ //Encrypt
+ string enc = pc.encrypt(strMessage);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("q/xJqqN6qbiZMXYmiQC1Fw==", enc);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the yay decryption.
+ /// Assumes that the input message is not deserialized
+ /// Decrypted and Deserialized string should match yay!
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestYayDecryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //string strMessage= "\"q/xJqqN6qbiZMXYmiQC1Fw==\"";
+ //Non deserialized string
+ string strMessage = "\"Wi24KS4pcTzvyuGOHubiXg==\"";
+ //Deserialize
+ strMessage = JsonConvert.DeserializeObject<string>(strMessage);
+ //decrypt
+ string dec = pc.decrypt(strMessage);
+ //deserialize again
+ strMessage = JsonConvert.DeserializeObject<string>(dec);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("yay!", strMessage);
+ TestComplete();
+ });
+ });
+ }
+ /// <summary>
+ /// Tests the yay encryption.
+ /// The output is not serialized
+ /// Encrypted string should match Wi24KS4pcTzvyuGOHubiXg==
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestYayEncryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //deserialized string
+ string strMessage = "yay!";
+ //serialize the string
+ strMessage = JsonConvert.SerializeObject(strMessage);
+ Console.WriteLine(strMessage);
+ //Encrypt
+ string enc = pc.encrypt(strMessage);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("Wi24KS4pcTzvyuGOHubiXg==", enc);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the array encryption.
+ /// The output is not serialized
+ /// Encrypted string should match the serialized object
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestArrayEncryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //create an empty array object
+ object[] objArr = { };
+ //serialize
+ string strArr = JsonConvert.SerializeObject(objArr);
+ //Encrypt
+ string enc = pc.encrypt(strArr);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("Ns4TB41JjT2NCXaGLWSPAQ==", enc);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <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, Asynchronous]
+ public void TestArrayDecryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //Input the deserialized string
+ string strMessage = "Ns4TB41JjT2NCXaGLWSPAQ==";
+ //decrypt
+ string dec = pc.decrypt(strMessage);
+ //create a serialized object
+ object[] objArr = { };
+ string res = JsonConvert.SerializeObject(objArr);
+ //compare the serialized object and the return of the Decrypt method
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual(res, dec);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the object encryption.
+ /// The output is not serialized
+ /// Encrypted string should match the serialized object
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestObjectEncryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //create an object
+ Object obj = new Object();
+ //serialize
+ string strObj = JsonConvert.SerializeObject(obj);
+ //encrypt
+ string enc = pc.encrypt(strObj);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("IDjZE9BHSjcX67RddfCYYg==", enc);
+ TestComplete();
+ });
+ });
+ }
+ /// <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, Asynchronous]
+ public void TestObjectDecryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ 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
+ string res = JsonConvert.SerializeObject(obj);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual(res, dec);
+ TestComplete();
+ });
+ });
+ }
+ /// <summary>
+ /// Tests my object encryption.
+ /// The output is not serialized
+ /// Encrypted string should match the serialized object
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestMyObjectEncryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //create an object of the custom class
+ CustomClass cc = new CustomClass();
+ //serialize it
+ string res = JsonConvert.SerializeObject(cc);
+
+ //encrypt it
+ string enc = pc.encrypt(res);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("Zbr7pEF/GFGKj1rOstp0tWzA4nwJXEfj+ezLtAr8qqE=", enc);
+ TestComplete();
+ });
+ });
+ }
+ /// <summary>
+ /// Tests my object decryption.
+ /// The output is not deserialized
+ /// Decrypted string should match the serialized object
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestMyObjectDecryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ 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();
+
+ //Serialize it
+ string res = JsonConvert.SerializeObject(cc);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual(res, dec);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the pub nub encryption2.
+ /// The output is not serialized
+ /// Encrypted string should match f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestPubNubEncryption2()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //Deserialized
+ string strMessage = "Pubnub Messaging API 2";
+ //serialize the message
+ strMessage = JsonConvert.SerializeObject(strMessage);
+
+ //encrypt
+ string enc = pc.encrypt(strMessage);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=", enc);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <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, Asynchronous]
+ public void TestPubNubDecryption2()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //Deserialized string
+ string strMessage = "f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=";
+ //Decrypt
+ string dec = pc.decrypt(strMessage);
+ //Deserialize
+ strMessage = JsonConvert.DeserializeObject<string>(dec);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("Pubnub Messaging API 2", strMessage);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the pub nub encryption1.
+ /// The input is not serialized
+ /// Encrypted string should match f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestPubNubEncryption1()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //non serialized string
+ string strMessage = "Pubnub Messaging API 1";
+ //serialize
+ strMessage = JsonConvert.SerializeObject(strMessage);
+ //encrypt
+ string enc = pc.encrypt(strMessage);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=", enc);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <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, Asynchronous]
+ public void TestPubNubDecryption1()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //deserialized string
+ string strMessage = "f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=";
+ //decrypt
+ string dec = pc.decrypt(strMessage);
+ //deserialize
+ strMessage = (dec != "**DECRYPT ERROR**") ? JsonConvert.DeserializeObject<string>(dec) : "";
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("Pubnub Messaging API 1", strMessage);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the stuff can encryption.
+ /// The input is serialized
+ /// Encrypted string should match zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestStuffCanEncryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //input serialized string
+ string strMessage = "{\"this stuff\":{\"can get\":\"complicated!\"}}";
+ //encrypt
+ string enc = pc.encrypt(strMessage);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF", enc);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the stuffcan decryption.
+ /// Assumes that the input message is deserialized
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestStuffcanDecryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //deserialized string
+ string strMessage = "zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF";
+ //decrypt
+ string dec = pc.decrypt(strMessage);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("{\"this stuff\":{\"can get\":\"complicated!\"}}", dec);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the hash encryption.
+ /// The input is serialized
+ /// Encrypted string should match GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g=
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestHashEncryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //serialized string
+ string strMessage = "{\"foo\":{\"bar\":\"foobar\"}}";
+ //encrypt
+ string enc = pc.encrypt(strMessage);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g=", enc);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the hash decryption.
+ /// Assumes that the input message is deserialized
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestHashDecryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ //deserialized string
+ string strMessage = "GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g=";
+ //decrypt
+ string dec = pc.decrypt(strMessage);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("{\"foo\":{\"bar\":\"foobar\"}}", dec);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the unicode chars encryption.
+ /// The input is not serialized
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestUnicodeCharsEncryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ string strMessage = "漢語";
+
+ strMessage = JsonConvert.SerializeObject(strMessage);
+ Console.WriteLine(strMessage);
+ string enc = pc.encrypt(strMessage);
+ Console.WriteLine(enc);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("+BY5/miAA8aeuhVl4d13Kg==", enc);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the unicode decryption.
+ /// Assumes that the input message is deserialized
+ /// Decrypted and Deserialized string should match the unicode chars
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestUnicodeCharsDecryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ string strMessage = "+BY5/miAA8aeuhVl4d13Kg==";
+ //JavaScriptSerializer js = new JavaScriptSerializer();
+ //decrypt
+ string dec = pc.decrypt(strMessage);
+ //deserialize
+ strMessage = (dec != "**DECRYPT ERROR**") ? JsonConvert.DeserializeObject<string>(dec) : "";
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("漢語", strMessage);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <summary>
+ /// Tests the german chars decryption.
+ /// Assumes that the input message is deserialized
+ /// Decrypted and Deserialized string should match the unicode chars
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestGermanCharsDecryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ string strMessage = "stpgsG1DZZxb44J7mFNSzg==";
+ //decrypt
+ string dec = pc.decrypt(strMessage);
+ //deserialize
+ strMessage = (dec != "**DECRYPT ERROR**") ? JsonConvert.DeserializeObject<string>(dec) : "";
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("ÜÖ", strMessage);
+ TestComplete();
+ });
+ });
+ }
+ /// <summary>
+ /// Tests the german encryption.
+ /// The input is not serialized
+ /// </summary>
+ [TestMethod, Asynchronous]
+ public void TestGermanCharsEncryption()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ PubnubCrypto pc = new PubnubCrypto("enigma");
+ string strMessage = "ÜÖ";
+
+ strMessage = JsonConvert.SerializeObject(strMessage);
+ Console.WriteLine(strMessage);
+ string enc = pc.encrypt(strMessage);
+ Console.WriteLine(enc);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.AreEqual("stpgsG1DZZxb44J7mFNSzg==", enc);
+ TestComplete();
+ });
+ });
+ }
+
+ /// <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
397 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/PubnubUnitTest.cs
@@ -0,0 +1,397 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using PubNub_Messaging;
+
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.Phone.Testing;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System.Threading;
+
+namespace PubnubWindowsPhone.Test.UnitTest
+{
+ public class PubnubUnitTest : IPubnubUnitTest
+ {
+ private bool _enableStubTest = true;
+ private string _testClassName = "";
+ private string _testCaseName = "";
+
+ public bool EnableStubTest
+ {
+ get
+ {
+ return _enableStubTest;
+ }
+ set
+ {
+ _enableStubTest = value;
+ }
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenAClientIsPresented_ThenPresenceShouldReturnReceivedMessage()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+#if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/subscribe/demo/my%2Fchannel-pnpres/0/0", "[[],\"13559007117760880\"]");
+ data.Add("/subscribe/demo/my%2Fchannel-pnpres/0/13559007117760880", "[[{\"action\": \"join\", \"timestamp\": 1355929955, \"uuid\": \"eb4c1645-1319-4425-865f-008563009d67\", \"occupancy\": 1}],\"13559011560379628\"]");
+ data.Add("/subscribe/demo/my%2Fchannel-pnpres/0/13559011560379628", "[[],\"13559011560379628\"]");
+ data.Add("/subscribe/demo/my%2Fchannel/0/0", "[[],\"13559006802662768\"]");
+ data.Add("/subscribe/demo/my%2Fchannel/0/13559006802662768", "[[\"demo test for stubs\"],\"13559014566792816\"]");
+ data.Add("/subscribe/demo/my%2Fchannel/0/13559014566792816", "[[],\"13559014566792816\"]");
+ data.Add("/v2/presence/sub_key/demo/channel/my%2Fchannel/leave", "{\"action\": \"leave\"}");
+#else
+ data.Add("/subscribe/demo/my/channel-pnpres/0/0", "[[],\"13559007117760880\"]");
+ data.Add("/subscribe/demo/my/channel-pnpres/0/13559007117760880", "[[{\"action\": \"join\", \"timestamp\": 1355929955, \"uuid\": \"eb4c1645-1319-4425-865f-008563009d67\", \"occupancy\": 1}],\"13559011560379628\"]");
+ data.Add("/subscribe/demo/my/channel-pnpres/0/13559011560379628", "[[],\"13559011560379628\"]");
+ data.Add("/subscribe/demo/my/channel/0/0", "[[],\"13559006802662768\"]");
+ data.Add("/subscribe/demo/my/channel/0/13559006802662768", "[[\"demo test for stubs\"],\"13559014566792816\"]");
+ data.Add("/subscribe/demo/my/channel/0/13559014566792816", "[[],\"13559014566792816\"]");
+ data.Add("/v2/presence/sub_key/demo/channel/my%252Fchannel/leave", "{\"action\": \"leave\"}");
+#endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenAClientIsPresented_IfHereNowIsCalledThenItShouldReturnInfo()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/v2/presence/sub_key/demo/channel/my%2Fchannel", "{\"uuids\":[\"eb4c1645-1319-4425-865f-008563009d67\"],\"occupancy\":1}");
+ #else
+ data.Add("/v2/presence/sub_key/demo/channel/my%252Fchannel", "{\"uuids\":[\"eb4c1645-1319-4425-865f-008563009d67\"],\"occupancy\":1}");
+ #endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenAMessageIsPublished_ThenUnencryptPublishShouldReturnSuccessCodeAndInfo()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/v2/history/sub-key/demo/channel/my%2Fchannel", "[[\"Pubnub Messaging API 1\"],13557486057035336,13559006802662769]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22Pubnub%20Messaging%20API%201%22", "[1,\"Sent\",\"13559014566792817\"]");
+ #else
+ data.Add("/publish/demo/demo/0/my/channel/0/%22Pubnub%20Messaging%20API%201%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/v2/history/sub-key/demo/channel/my%252Fchannel", "[[\"Pubnub Messaging API 1\"],13557486057035336,13559006802662769]");
+ #endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenAMessageIsPublished_ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%7B%22foo%22%3A%22hi%21%22%2C%22bar%22%3A%5B1%2C2%2C3%2C4%2C5%5D%7D", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/v2/history/sub-key/demo/channel/my%2Fchannel", "[[{\"foo\":\"hi!\",\"bar\":[1,2,3,4,5]}],13557486057035336,13559006802662769]");
+ #else
+ data.Add("/publish/demo/demo/0/my/channel/0/%7B%22foo%22%3A%22hi%21%22%2C%22bar%22%3A%5B1%2C2%2C3%2C4%2C5%5D%7D", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/v2/history/sub-key/demo/channel/my%252Fchannel", "[[{\"foo\":\"hi!\",\"bar\":[1,2,3,4,5]}],13557486057035336,13559006802662769]");
+ #endif
+ return data;
+ }
+
+ [Asynchronous] //TODO:
+ private Dictionary<string, string> Load_WhenAMessageIsPublished_ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/v2/history/sub-key/demo/channel/my%2Fchannel", "[[\"nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2\"],13559215464464812,13559215464464812]");
+#else
+ data.Add("/publish/demo/demo/0/my/channel/0/%22nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/v2/history/sub-key/demo/channel/my%252Fchannel", "[[\"nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2\"],13559215464464812,13559215464464812]");
+#endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenAMessageIsPublished_ThenEncryptPublishShouldReturnSuccessCodeAndInfo()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22%2BBY5%2FmiAA8aeuhVl4d13Kg%3D%3D%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/v2/history/sub-key/demo/channel/my%2Fchannel", "[[\"+BY5/miAA8aeuhVl4d13Kg==\"],13557486057035336,13559006802662769]");
+#else
+ data.Add("/publish/demo/demo/0/my/channel/0/%22%2BBY5/miAA8aeuhVl4d13Kg%3D%3D%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/v2/history/sub-key/demo/channel/my%252Fchannel", "[[\"+BY5/miAA8aeuhVl4d13Kg==\"],13557486057035336,13559006802662769]");
+#endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenAMessageIsPublished_ThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/publish/demo/demo/3f75435fcd800f5d0476fc0fb5b572d1/my%2Fchannel/0/%22f42pIQcWZ9zbTbH8cyLwB%2FtdvRxjFLOYcBNMVKeHS54%3D%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/v2/history/sub-key/demo/channel/my%2Fchannel", "[[\"f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=\"],13559191494674157,13559191494674157]");
+#else
+ data.Add("/publish/demo/demo/3f75435fcd800f5d0476fc0fb5b572d1/my/channel/0/%22f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54%3D%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/v2/history/sub-key/demo/channel/my%252Fchannel", "[[\"f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=\"],13559191494674157,13559191494674157]");
+#endif
+
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenAMessageIsPublished_ThenOptionalSecretKeyShouldBeProvidedInConstructor()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/publish/demo/demo/d759c756abbd45a9864adc7f2b91393e/my%2Fchannel/0/%22Pubnub%20API%20Usage%20Example%22", "[1,\"Sent\",\"13559014566792817\"]");
+#else
+ data.Add("/publish/demo/demo/d759c756abbd45a9864adc7f2b91393e/my/channel/0/%22Pubnub%20API%20Usage%20Example%22", "[1,\"Sent\",\"13559014566792817\"]");
+#endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenAMessageIsPublished_IfSSLNotProvidedThenDefaultShouldBeFalse()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22Pubnub%20API%20Usage%20Example%22", "[1,\"Sent\",\"13559014566792817\"]");
+ #else
+ data.Add("/publish/demo/demo/0/my/channel/0/%22Pubnub%20API%20Usage%20Example%22", "[1,\"Sent\",\"13559014566792817\"]");
+ #endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenDetailedHistoryIsRequested_DetailHistoryCount10ReturnsRecords()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/v2/history/sub-key/demo/channel/my%2Fchannel", "[[\"f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=\",\"Pubnub API Usage Example\",\"nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2\",\"Pubnub API Usage Example\",\"nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2\",\"+BY5/miAA8aeuhVl4d13Kg==\",\"Pubnub API Usage Example\",\"f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=\",{\"foo\":\"hi!\",\"bar\":[1,2,3,4,5]},\"Pubnub Messaging API 1\"],13559191494674157,13559319777162196]");
+#else
+ data.Add("/v2/history/sub-key/demo/channel/my%252Fchannel", "[[\"f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=\",\"Pubnub API Usage Example\",\"nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2\",\"Pubnub API Usage Example\",\"nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2\",\"+BY5/miAA8aeuhVl4d13Kg==\",\"Pubnub API Usage Example\",\"f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=\",{\"foo\":\"hi!\",\"bar\":[1,2,3,4,5]},\"Pubnub Messaging API 1\"],13559191494674157,13559319777162196]");
+#endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenDetailedHistoryIsRequested_DetailHistoryCount10ReverseTrueReturnsRecords()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/v2/history/sub-key/demo/channel/my%2Fchannel", "[[\"Pubnub API Usage Example\",\"nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2\",\"+BY5/miAA8aeuhVl4d13Kg==\",\"Pubnub API Usage Example\",\"f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=\",{\"foo\":\"hi!\",\"bar\":[1,2,3,4,5]},\"Pubnub Messaging API 1\",\"DetailedHistoryStartTimeWithReverseTrue 13557486100000000 0\",\"DetailedHistoryStartTimeWithReverseTrue 13557486100000000 1\",\"DetailedHistoryStartTimeWithReverseTrue 13557486100000000 3\"],13557486057035336,13557486128690220]");
+ #else
+ data.Add("/v2/history/sub-key/demo/channel/my%252Fchannel", "[[\"Pubnub API Usage Example\",\"nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2\",\"+BY5/miAA8aeuhVl4d13Kg==\",\"Pubnub API Usage Example\",\"f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=\",{\"foo\":\"hi!\",\"bar\":[1,2,3,4,5]},\"Pubnub Messaging API 1\",\"DetailedHistoryStartTimeWithReverseTrue 13557486100000000 0\",\"DetailedHistoryStartTimeWithReverseTrue 13557486100000000 1\",\"DetailedHistoryStartTimeWithReverseTrue 13557486100000000 3\"],13557486057035336,13557486128690220]");
+ #endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenDetailedHistoryIsRequested_DetailedHistoryStartWithReverseTrue()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/v2/history/sub-key/demo/channel/my%2Fchannel", "[[\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 0\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 1\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 2\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 3\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 4\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 4\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 6\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 7\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 8\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 9\"],13559326456056557,13559327017296315]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%200%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%201%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%202%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%203%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%204%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%205%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%206%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%207%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%208%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22DetailedHistoryStartTimeWithReverseTrue%209%22", "[1,\"Sent\",\"13559014566792817\"]");
+#else
+ data.Add("/v2/history/sub-key/demo/channel/my%252Fchannel", "[[\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 0\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 1\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 2\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 3\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 4\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 4\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 6\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 7\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 8\",\"DetailedHistoryStartTimeWithReverseTrue 13559326410000000 9\"],13559326456056557,13559327017296315]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%200%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%201%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%202%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%203%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%204%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%205%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%206%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%207%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%208%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/publish/demo/demo/0/my/channel/0/%22DetailedHistoryStartTimeWithReverseTrue%209%22", "[1,\"Sent\",\"13559014566792817\"]");
+#endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenGetRequestServerTime_ThenItShouldReturnTimeStamp()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ data.Add("/time/0", "[13559011090230537]");
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenSubscribedToAChannel_ThenSubscribeShouldReturnReceivedMessage()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+ #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22Test%20for%20WhenSubscribedToAChannel%20ThenItShouldReturnReceivedMessage%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/subscribe/demo/my%2Fchannel/0/0", "[[],\"13559006802662768\"]");
+ data.Add("/subscribe/demo/my%2Fchannel/0/13559006802662768", "[[\"Test for WhenSubscribedToAChannel ThenItShouldReturnReceivedMessage\"],\"13559014566792816\"]");
+ data.Add("/subscribe/demo/my%2Fchannel/0/13559014566792816", "[[],\"13559014566792816\"]");
+ data.Add("/v2/presence/sub_key/demo/channel/my%2Fchannel/leave", "{\"action\": \"leave\"}");
+#else
+ data.Add("/publish/demo/demo/0/my/channel/0/%22Test%20for%20WhenSubscribedToAChannel%20ThenItShouldReturnReceivedMessage%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/subscribe/demo/my/channel/0/0", "[[],\"13559006802662768\"]");
+ data.Add("/subscribe/demo/my/channel/0/13559006802662768", "[[\"Test for WhenSubscribedToAChannel ThenItShouldReturnReceivedMessage\"],\"13559014566792816\"]");
+ data.Add("/subscribe/demo/my/channel/0/13559014566792816", "[[],\"13559014566792816\"]");
+ data.Add("/v2/presence/sub_key/demo/channel/my%252Fchannel/leave", "{\"action\": \"leave\"}");
+#endif
+ return data;
+ }
+
+ [Asynchronous]
+ private Dictionary<string, string> Load_WhenSubscribedToAChannel_ThenSubscribeShouldReturnConnectStatus()
+ {
+ Dictionary<string, string> data = new Dictionary<string, string>();
+#if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
+ data.Add("/publish/demo/demo/0/my%2Fchannel/0/%22Test%20for%20WhenSubscribedToAChannel%20ThenItShouldReturnReceivedMessage%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/subscribe/demo/my%2Fchannel/0/0", "[[],\"13559006802662768\"]");
+ data.Add("/subscribe/demo/my%2Fchannel/0/13559006802662768", "[[\"Test for WhenSubscribedToAChannel ThenItShouldReturnReceivedMessage\"],\"13559014566792816\"]");
+ data.Add("/subscribe/demo/my%2Fchannel/0/13559014566792816", "[[],\"13559014566792816\"]");
+ data.Add("/v2/presence/sub_key/demo/channel/my%2Fchannel/leave", "{\"action\": \"leave\"}");
+#else
+ data.Add("/publish/demo/demo/0/my/channel/0/%22Test%20for%20WhenSubscribedToAChannel%20ThenItShouldReturnReceivedMessage%22", "[1,\"Sent\",\"13559014566792817\"]");
+ data.Add("/subscribe/demo/my/channel/0/0", "[[],\"13559006802662768\"]");
+ data.Add("/subscribe/demo/my/channel/0/13559006802662768", "[[\"Test for WhenSubscribedToAChannel ThenItShouldReturnReceivedMessage\"],\"13559014566792816\"]");
+ data.Add("/subscribe/demo/my/channel/0/13559014566792816", "[[],\"13559014566792816\"]");
+ data.Add("/v2/presence/sub_key/demo/channel/my%252Fchannel/leave", "{\"action\": \"leave\"}");
+#endif
+ return data;
+ }
+
+ [Asynchronous]
+ public string GetStubResponse(Uri request)
+ {
+ Dictionary<string,string> respDic = null;
+ string stubResponse = "!! Stub Response Not Assigned !!";
+
+ switch (_testClassName)
+ {
+ case "WhenAClientIsPresented":
+ switch (_testCaseName)
+ {
+ case "ThenPresenceShouldReturnReceivedMessage":
+ respDic = Load_WhenAClientIsPresented_ThenPresenceShouldReturnReceivedMessage();
+ break;
+ case "IfHereNowIsCalledThenItShouldReturnInfo":
+ respDic = Load_WhenAClientIsPresented_IfHereNowIsCalledThenItShouldReturnInfo();
+ break;
+ default:
+ break;
+ }
+ break;
+ case "WhenAMessageIsPublished":
+ switch (_testCaseName)
+ {
+ case "ThenUnencryptPublishShouldReturnSuccessCodeAndInfo":
+ respDic = Load_WhenAMessageIsPublished_ThenUnencryptPublishShouldReturnSuccessCodeAndInfo();
+ break;
+ case "ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo":
+ respDic = Load_WhenAMessageIsPublished_ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo();
+ break;
+ case "ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo":
+ respDic = Load_WhenAMessageIsPublished_ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo();
+ break;
+ case "ThenEncryptPublishShouldReturnSuccessCodeAndInfo":
+ respDic = Load_WhenAMessageIsPublished_ThenEncryptPublishShouldReturnSuccessCodeAndInfo();
+ break;
+ case "ThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo":
+ respDic = Load_WhenAMessageIsPublished_ThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo();
+ break;
+ case "ThenOptionalSecretKeyShouldBeProvidedInConstructor":
+ respDic = Load_WhenAMessageIsPublished_ThenOptionalSecretKeyShouldBeProvidedInConstructor();
+ break;
+ case "IfSSLNotProvidedThenDefaultShouldBeFalse":
+ respDic = Load_WhenAMessageIsPublished_IfSSLNotProvidedThenDefaultShouldBeFalse();
+ break;
+ default:
+ break;
+ }
+ break;
+ case "WhenDetailedHistoryIsRequested":
+ switch (_testCaseName)
+ {
+ case "DetailHistoryCount10ReturnsRecords":
+ respDic = Load_WhenDetailedHistoryIsRequested_DetailHistoryCount10ReturnsRecords();
+ break;
+ case "DetailHistoryCount10ReverseTrueReturnsRecords":
+ respDic = Load_WhenDetailedHistoryIsRequested_DetailHistoryCount10ReverseTrueReturnsRecords();
+ break;
+ case "DetailedHistoryStartWithReverseTrue":
+ respDic = Load_WhenDetailedHistoryIsRequested_DetailedHistoryStartWithReverseTrue();
+ break;
+ default:
+ break;
+ }
+ break;
+ case "WhenGetRequestServerTime":
+ switch (_testCaseName)
+ {
+ case "ThenItShouldReturnTimeStamp":
+ respDic = Load_WhenGetRequestServerTime_ThenItShouldReturnTimeStamp();
+ break;
+ default:
+ break;
+ }
+ break;
+ case "WhenSubscribedToAChannel":
+ switch (_testCaseName)
+ {
+ case "ThenSubscribeShouldReturnReceivedMessage":
+ respDic = Load_WhenSubscribedToAChannel_ThenSubscribeShouldReturnReceivedMessage();
+ break;
+ case "ThenSubscribeShouldReturnConnectStatus":
+ respDic = Load_WhenSubscribedToAChannel_ThenSubscribeShouldReturnConnectStatus();
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (respDic != null && respDic.ContainsKey(request.AbsolutePath))
+ {
+ stubResponse = respDic[request.AbsolutePath];
+ }
+ else
+ {
+ stubResponse = "!! Stub Response Not Assigned !!";
+ }
+
+ return stubResponse;
+ }
+
+ public string TestCaseName
+ {
+ get
+ {
+ return _testCaseName;
+ }
+ set
+ {
+ _testCaseName = value;
+ }
+ }
+
+
+ public string TestClassName
+ {
+ get
+ {
+ return _testClassName;
+ }
+ set
+ {
+ _testClassName = value;
+ }
+ }
+ }
+}
View
163 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenAClientIsPresented.cs
@@ -0,0 +1,163 @@
+using System;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.Phone.Testing;
+using PubNub_Messaging;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System.Threading;
+using System.Collections.Generic;
+
+namespace PubnubWindowsPhone.Test.UnitTest
+{
+ [TestClass]
+ public class WhenAClientIsPresented : WorkItemTest
+ {
+ ManualResetEvent manualEvent1 = new ManualResetEvent(false);
+ ManualResetEvent manualEvent2 = new ManualResetEvent(false);
+ ManualResetEvent manualEvent3 = new ManualResetEvent(false);
+
+ ManualResetEvent manualEvent4 = new ManualResetEvent(false);
+ ManualResetEvent preUnsubEvent = new ManualResetEvent(false);
+
+ static bool receivedFlag1 = false;
+ static bool receivedFlag2 = false;
+
+ [TestMethod,Asynchronous]
+ public void ThenPresenceShouldReturnReceivedMessage()
+ {
+ receivedFlag1 = false;
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
+ string channel = "my/channel";
+
+ PubnubUnitTest unitTest = new PubnubUnitTest();
+ unitTest.TestClassName = "WhenAClientIsPresented";
+ unitTest.TestCaseName = "ThenPresenceShouldReturnReceivedMessage";
+ pubnub.PubnubUnitTest = unitTest;
+
+ 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);
+
+ pubnub.presence_unsubscribe<string>(channel, DummyMethodForPreUnSub);
+ preUnsubEvent.WaitOne(2000);
+
+ manualEvent2.WaitOne(310 * 1000);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.IsTrue(receivedFlag1, "Presence message not received");
+ TestComplete();
+ });
+ });
+ }
+
+ [Asynchronous]
+ 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,Asynchronous]
+ public void IfHereNowIsCalledThenItShouldReturnInfo()
+ {
+ receivedFlag2 = false;
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
+ string channel = "my/channel";
+
+ PubnubUnitTest unitTest = new PubnubUnitTest();
+ unitTest.TestClassName = "WhenAClientIsPresented";
+ unitTest.TestCaseName = "IfHereNowIsCalledThenItShouldReturnInfo";
+ pubnub.PubnubUnitTest = unitTest;
+
+ pubnub.here_now<string>(channel, ThenHereNowShouldReturnMessage);
+ manualEvent4.WaitOne();
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.IsTrue(receivedFlag2, "here_now message not received");
+ TestComplete();
+ });
+ });
+ }
+
+ [Asynchronous]
+ void ThenHereNowShouldReturnMessage(string receivedMessage)
+ {
+ try
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ if (!string.IsNullOrWhiteSpace(receivedMessage))
+ {
+ object[] receivedObj = JsonConvert.DeserializeObject<object[]>(receivedMessage);
+ var dic = ((JContainer)receivedObj[0])["uuids"];
+ if (dic != null)
+ {
+ receivedFlag2 = true;
+ }
+ }
+ });
+ }
+ catch { }
+ finally
+ {
+ manualEvent4.Set();
+ }
+ }
+
+ [Asynchronous]
+ void DummyMethodForSubscribe(string receivedMessage)
+ {
+ manualEvent1.Set();
+ //Dummary callback method for subscribe and unsubscribe to test presence
+ }
+
+ [Asynchronous]
+ void DummyMethodForUnSubscribe(string receivedMessage)
+ {
+ manualEvent3.Set();
+ //Dummary callback method for unsubscribe to test presence
+ }
+
+ [Asynchronous]
+ void DummyMethodForPreUnSub(string receivedMessage)
+ {
+ preUnsubEvent.Set();
+ }
+ }
+}
View
608 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenAMessageIsPublished.cs
@@ -0,0 +1,608 @@
+using System;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Ink;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.Phone.Testing;
+using PubNub_Messaging;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Newtonsoft.Json.Utilities;
+using Newtonsoft.Json.Converters;
+using Newtonsoft.Json.Serialization;
+using System.Threading;
+//using System.Collections.Generic;
+using System.Runtime.Serialization.Json;
+
+namespace PubnubWindowsPhone.Test.UnitTest
+{
+ [TestClass]
+ public class WhenAMessageIsPublished : WorkItemTest
+ {
+ JsonSerializer serializer = new JsonSerializer();
+
+ 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 = "";
+
+ System.Collections.Generic.List<string> errors = new System.Collections.Generic.List<string>();
+
+ [TestMethod, Asynchronous]
+ public void ThenUnencryptPublishShouldReturnSuccessCodeAndInfo()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ isUnencryptPublished = false;
+ Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
+ string channel = "my/channel";
+ string message = messageForUnencryptPublish;
+
+ PubnubUnitTest unitTest = new PubnubUnitTest();
+ unitTest.TestClassName = "WhenAMessageIsPublished";
+ unitTest.TestCaseName = "ThenUnencryptPublishShouldReturnSuccessCodeAndInfo";
+ pubnub.PubnubUnitTest = unitTest;
+
+ pubnub.publish<string>(channel, message, ReturnSuccessUnencryptPublishCodeCallback);
+ manualEvent1.WaitOne(310 * 1000);
+
+ if (!isUnencryptPublished)
+ {
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.IsTrue(isUnencryptPublished, "Unencrypt Publish Failed");
+ TestComplete();
+ });
+ }
+ else
+ {
+ pubnub.detailedHistory<string>(channel, -1, unEncryptPublishTimetoken, -1, false, CaptureUnencryptDetailedHistoryCallback);
+ mreUnencryptDH.WaitOne(310 * 1000);
+ Deployment.Current.Dispatcher.BeginInvoke(() =>
+ {
+ Assert.IsTrue(isUnencryptDH, "Unable to match the successful unencrypt Publish");
+ TestComplete();
+ });
+ }
+ });
+ }
+
+ [TestMethod, Asynchronous]
+ public void ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo()
+ {
+ ThreadPool.QueueUserWorkItem((s) =>
+ {
+ isUnencryptObjectPublished = false;
+ Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
+ string channel = "my/channel";
+ object message = new CustomClass();
+ messageObjectForUnencryptPublish = JsonConvert.SerializeObject(message);
+
+ PubnubUnitTest unitTest = new PubnubUnitTest();
+ unitTest.TestClassName = "WhenAMessageIsPublished";
+ unitTest.TestCaseName = "ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo";
+ pubnub.PubnubUnitTest = unitTest;
+
+ pubnub.publish<string>(cha