Permalink
Browse files

Refactor code all mono versions

  • Loading branch information...
1 parent c945ed5 commit 45afe6dac97af59665c19fe3b0009d7e6371e37a @crimsonred crimsonred committed Jan 14, 2013
Showing with 7,967 additions and 9,609 deletions.
  1. +2 −2 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Andr.Unit.csproj
  2. +19 −84 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/Common.cs
  3. +462 −499 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/EncryptionTests.cs
  4. +1 −1 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/MainActivity.cs
  5. +494 −492 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/PubnubUnitTest.cs
  6. +56 −79 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenAClientIsPresented.cs
  7. +165 −167 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenAMessageIsPublished.cs
  8. +305 −841 ...for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenDetailedHistoryIsRequested.cs
  9. +23 −26 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenGetRequestServerTime.cs
  10. +43 −66 mono-for-android/3.3.0.1/Pubnub-Messaging/Andr.Unit-master/Andr.Unit/WhenSubscribedToAChannel.cs
  11. +204 −7 mono-for-android/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/LaunchScreen.cs
  12. +25 −94 mono-for-android/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/MainActivity.cs
  13. +2 −2 mono-for-android/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/Properties/AndroidManifest.xml
  14. +2 −1 ...roid/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/{PubNub_Messaging.csproj → PubNubMessaging.csproj}
  15. +689 −544 mono-for-android/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/Pubnub.cs
  16. +118 −55 mono-for-android/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/Resources/Resource.designer.cs
  17. +17 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/Resources/layout-large/Launch.axml
  18. +18 −1 mono-for-android/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/Resources/layout/Launch.axml
  19. +89 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/Resources/layout/Proxy.axml
  20. +11 −0 mono-for-android/3.3.0.1/Pubnub-Messaging/PubNub_Messaging/Resources/values/Strings.xml
  21. +2 −2 mono-for-android/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.sln
  22. +8 −7 mono-for-android/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.userprefs
  23. +1 −1 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.csproj
  24. BIN mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.pidb
  25. +695 −547 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Console/Pubnub.cs
  26. +63 −18 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Console/Pubnub_Example.cs
  27. +9 −13 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNub-Messaging.userprefs
  28. +19 −84 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/Common.cs
  29. +167 −203 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/EncryptionTests.cs
  30. +4 −1 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/PubNub-Messaging.Tests.csproj
  31. BIN mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/PubNub-Messaging.Tests.pidb
  32. +92 −90 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/PubnubUnitTest.cs
  33. +72 −95 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAClientIsPresented.cs
  34. +35 −40 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAMessageIsPublished.cs
  35. +472 −1,009 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/WhenDetailedHistoryIsRequested.cs
  36. +17 −20 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/WhenGetRequestServerTime.cs
  37. +34 −39 mono-for-linux/3.3.0.1/PubNub-Messaging/PubNubTest/WhenSubscribedToAChannel.cs
  38. +1 −1 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/AssemblyInfo.cs
  39. +1 −1 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.csproj
  40. +695 −547 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/Pubnub.cs
  41. +62 −18 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/{Pubnub_Example.cs → PubnubExample.cs}
  42. +12 −19 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Messaging.userprefs
  43. +1 −1 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/AssemblyInfo.cs
  44. +19 −84 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/Common.cs
  45. +120 −158 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/EncryptionTests.cs
  46. +92 −90 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/PubnubUnitTest.cs
  47. +72 −95 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAClientIsPresented.cs
  48. +35 −38 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAMessageIsPublished.cs
  49. +472 −1,009 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenDetailedHistoryIsRequested.cs
  50. +14 −18 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenGetRequestServerTime.cs
  51. +34 −39 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenSubscribedToAChannel.cs
  52. +18 −83 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.Tests/Common.cs
  53. +448 −486 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.Tests/EncryptionTests.cs
  54. +92 −90 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.Tests/PubnubUnitTest.cs
  55. +71 −93 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.Tests/WhenAClientIsPresented.cs
  56. +35 −38 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.Tests/WhenAMessageIsPublished.cs
  57. +305 −841 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.Tests/WhenDetailedHistoryIsRequested.cs
  58. +14 −18 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.Tests/WhenGetRequestServerTime.cs
  59. +28 −34 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.Tests/WhenSubscribedToAChannel.cs
  60. +7 −5 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging.userprefs
  61. +689 −544 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging/Pubnub.cs
  62. +69 −4 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging/Pubnub_MessagingMain.cs
  63. +126 −125 monotouch/3.3.0.1/Pubnub-Messaging/Pubnub-Messaging/Pubnub_MessagingSub.cs
@@ -129,9 +129,9 @@
<Project>{E6C3413C-919B-486D-8B6C-225CBD921B98}</Project>
<Name>Newtonsoft.Json.MonoDroid</Name>
</ProjectReference>
- <ProjectReference Include="..\..\PubNub_Messaging\PubNub_Messaging.csproj">
+ <ProjectReference Include="..\..\PubNub_Messaging\PubNubMessaging.csproj">
<Project>{F1BE10BB-84AE-42A0-895A-8A7918F87A28}</Project>
- <Name>PubNub_Messaging</Name>
+ <Name>PubNubMessaging</Name>
</ProjectReference>
</ItemGroup>
</Project>
@@ -1,108 +1,43 @@
using System;
-using PubNub_Messaging;
using System.Collections.Generic;
using System.ComponentModel;
+using PubNubMessaging.Core;
-namespace PubNubTest
+namespace PubNubMessaging.Tests
{
public class Common
{
- public object objResponse = null;
- public bool deliveryStatus = false;
+ public object Response { get; set; }
+ public bool DeliveryStatus { get; set; }
+
+ public PubnubUnitTest CreateUnitTestInstance(string testClassName, string testCaseName)
+ {
+ PubnubUnitTest unitTest = new PubnubUnitTest();
+ unitTest.TestClassName = testClassName;
+ unitTest.TestCaseName = testCaseName;
+ return unitTest;
+ }
public void DisplayReturnMessageDummy(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");
- }
//deliveryStatus = true;
//objResponse = result;
}
public 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");
- }
- deliveryStatus = true;
- objResponse = result;
- }
-
- 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));
- }
- }
- }
- else
- {
- Console.WriteLine(result.ToString());
- }
+ DeliveryStatus = true;
+ Response = result;
}
public long Timestamp(Pubnub pubnub)
{
- deliveryStatus = false;
-
- pubnub.time(DisplayReturnMessage);
- while (!deliveryStatus) ;
+ DeliveryStatus = false;
+
+ pubnub.Time(DisplayReturnMessage);
+ while (!DeliveryStatus) ;
- IList<object> fields = objResponse as IList<object>;
+ IList<object> fields = Response as IList<object>;
return Convert.ToInt64(fields[0].ToString());
}
}
Oops, something went wrong.

0 comments on commit 45afe6d

Please sign in to comment.