Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moving repo

  • Loading branch information...
commit a877279ff6a7718565e70636479d8f7fb0ce58da 1 parent f95a772
geremy authored
Showing with 2 additions and 6,407 deletions.
  1. +0 −27 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/AssemblyInfo.cs
  2. BIN  mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/Library/Newtonsoft.Json.dll
  3. +0 −1  mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.cs
  4. +0 −60 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.csproj
  5. +0 −3,591 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/Pubnub.cs
  6. +0 −244 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/PubnubExample.cs
  7. +0 −21 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/app.config
  8. +0 −31 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Messaging.sln
  9. +0 −61 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Messaging.userprefs
  10. +0 −27 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/AssemblyInfo.cs
  11. +0 −45 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/Common.cs
  12. +0 −473 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/EncryptionTests.cs
  13. +0 −74 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/PubNub-Messaging.Tests.csproj
  14. +0 −532 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/PubnubUnitTest.cs
  15. +0 −180 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAClientIsPresented.cs
  16. +0 −175 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAMessageIsPublished.cs
  17. +0 −537 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenDetailedHistoryIsRequested.cs
  18. +0 −142 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenGetRequestHistoryMessages.cs
  19. +0 −44 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenGetRequestServerTime.cs
  20. +0 −103 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenSubscribedToAChannel.cs
  21. +0 −18 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/app.config
  22. +2 −21 mono-for-mac/README.md
View
27 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/AssemblyInfo.cs
@@ -1,27 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("PubNub-Messaging")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("PubSub")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("1.0.*")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
-
View
BIN  mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/Library/Newtonsoft.Json.dll
Binary file not shown
View
1  mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.cs
@@ -1 +0,0 @@
-
View
60 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/PubNub-Messaging.csproj
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>10.0.0</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{9A973E1B-A9F2-400F-A5DE-C95C085A50EC}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>PubNubConsole</RootNamespace>
- <AssemblyName>PubNub-Messaging</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <DebugSymbols>True</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>False</Optimize>
- <OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <PlatformTarget>x86</PlatformTarget>
- <Externalconsole>True</Externalconsole>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <DebugType>none</DebugType>
- <Optimize>True</Optimize>
- <OutputPath>bin\Release</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <PlatformTarget>x86</PlatformTarget>
- <Externalconsole>True</Externalconsole>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Runtime.Serialization" />
- <Reference Include="System.ServiceModel.Web" />
- <Reference Include="System.Web.Extensions" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="Newtonsoft.Json">
- <HintPath>Library\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="System.Configuration" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="AssemblyInfo.cs" />
- <Compile Include="Pubnub.cs" />
- <Compile Include="PubnubExample.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <ItemGroup>
- <None Include="app.config" />
- <None Include="Library\Newtonsoft.Json.dll" />
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Library\" />
- </ItemGroup>
-</Project>
View
3,591 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/Pubnub.cs
0 additions, 3,591 deletions not shown
View
244 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/PubnubExample.cs
@@ -1,244 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.ComponentModel;
-using System.Threading;
-
-namespace PubNubMessaging.Core
-{
- public class PubnubExample
- {
- static public Pubnub pubnub;
-
- static public bool deliveryStatus = false;
- static public string channel = "";
-
- static public void Main()
- {
- PubnubProxy proxy = null;
-
- Console.WriteLine("HINT: TO TEST RE-CONNECT AND CATCH-UP,");
- Console.WriteLine(" DISCONNECT YOUR MACHINE FROM NETWORK/INTERNET AND ");
- Console.WriteLine(" RE-CONNECT YOUR MACHINE AFTER SOMETIME.");
- Console.WriteLine();
- Console.WriteLine(" IF NO NETWORK BEFORE MAX RE-TRY CONNECT,");
- Console.WriteLine(" NETWORK ERROR MESSAGE WILL BE SENT");
- Console.WriteLine();
-
- Console.WriteLine("ENTER Channel Name");
- channel = Console.ReadLine();
-
- Console.WriteLine(string.Format("Channel = {0}",channel));
- Console.WriteLine();
-
- Console.WriteLine("Enable SSL? ENTER Y for Yes, else N");
- string enableSSL = Console.ReadLine();
- if (enableSSL.Trim().ToLower() == "y")
- {
- Console.WriteLine("SSL Enabled");
- }
- else
- {
- Console.WriteLine("SSL NOT Enabled");
- }
- Console.WriteLine();
-
- Console.WriteLine("ENTER cipher key for encryption feature.");
- Console.WriteLine("If you don't want to avail at this time, press ENTER.");
- string cipheryKey = Console.ReadLine();
- if (cipheryKey.Trim().Length > 0)
- {
- Console.WriteLine("Cipher key provided.");
- }
- else
- {
- Console.WriteLine("No Cipher key provided");
- }
- Console.WriteLine();
-
- pubnub = new Pubnub("demo", "demo", "", cipheryKey,
- (enableSSL.Trim().ToLower() == "y") ? true : false);
-
- Console.WriteLine("Use Custom Session UUID? ENTER Y for Yes, else N");
- string enableCustomUUID = Console.ReadLine();
- if (enableCustomUUID.Trim().ToLower() == "y")
- {
- Console.WriteLine("ENTER Session UUID.");
- string sessionUUID = Console.ReadLine();
- pubnub.SessionUUID = sessionUUID;
- Console.WriteLine("Accepted Custom Session UUID.");
- }
- else
- {
- Console.WriteLine("Default Session UUID opted.");
- }
- Console.WriteLine();
-
- Console.WriteLine("Proxy Server exists? ENTER Y for Yes, else N");
- string enableProxy = Console.ReadLine();
- if (enableProxy.Trim().ToLower() == "y")
- {
- bool proxyAccepted = false;
- while (!proxyAccepted)
- {
- Console.WriteLine("ENTER proxy server name or IP.");
- string proxyServer = Console.ReadLine();
- Console.WriteLine("ENTER port number of proxy server.");
- string proxyPort = Console.ReadLine();
- int port;
- Int32.TryParse(proxyPort, out port);
- Console.WriteLine("ENTER user name for proxy server authentication.");
- string proxyUsername = Console.ReadLine();
- Console.WriteLine("ENTER password for proxy server authentication.");
- string proxyPassword = Console.ReadLine();
-
- proxy = new PubnubProxy();
- proxy.ProxyServer = proxyServer;
- proxy.ProxyPort = port;
- proxy.ProxyUserName = proxyUsername;
- proxy.ProxyPassword = proxyPassword;
- try
- {
- pubnub.Proxy = proxy;
- proxyAccepted = true;
- Console.WriteLine("Proxy details accepted");
- }
- catch (MissingFieldException mse)
- {
- Console.WriteLine(mse.Message);
- Console.WriteLine("Please RE-ENTER Proxy Server details.");
- }
- }
- }
- else
- {
- Console.WriteLine("No Proxy");
- }
- Console.WriteLine();
-
- Console.WriteLine("ENTER 1 FOR Subscribe (not implementing connectCallback)");
- Console.WriteLine("ENTER 2 FOR Subscribe (implementing connectCallback)");
- Console.WriteLine("ENTER 3 FOR Publish");
- Console.WriteLine("ENTER 4 FOR Presence");
- Console.WriteLine("ENTER 5 FOR Detailed History");
- Console.WriteLine("ENTER 6 FOR Here_Now");
- Console.WriteLine("ENTER 7 FOR Unsubscribe");
- Console.WriteLine("ENTER 8 FOR Presence-Unsubscribe");
- Console.WriteLine("ENTER 9 FOR Time");
- Console.WriteLine("ENTER 0 FOR EXIT OR QUIT");
-
- bool exitFlag = false;
-
- Console.WriteLine("");
- while (!exitFlag)
- {
- string userinput = Console.ReadLine();
- switch (userinput)
- {
- case "0":
- exitFlag = true;
- pubnub.EndPendingRequests();
- break;
- case "1":
- Console.WriteLine("Running subscribe() (not implementing connectCallback)");
- pubnub.Subscribe<string>(channel, DisplayReturnMessage);
- break;
- case "2":
- Console.WriteLine("Running subscribe() (implementing connectCallback)");
- pubnub.Subscribe<string>(channel, DisplayReturnMessage, DisplayConnectStatusMessage);
- break;
- case "3":
- Console.WriteLine("Running publish()");
- Console.WriteLine("Enter the message for publish. To exit loop, enter QUIT");
- string publishMsg = Console.ReadLine();
- double doubleData;
- int intData;
- if (int.TryParse(publishMsg, out intData)) //capture numeric data
- {
- pubnub.Publish<string>(channel, intData, DisplayReturnMessage);
- }
- else if (double.TryParse(publishMsg, out doubleData)) //capture numeric data
- {
- pubnub.Publish<string>(channel, doubleData, DisplayReturnMessage);
- }
- else
- {
- //check whether any numeric is sent in double quotes
- if (publishMsg.IndexOf("\"") == 0 && publishMsg.LastIndexOf("\"") == publishMsg.Length - 1)
- {
- string strMsg = publishMsg.Substring(1, publishMsg.Length - 2);
- if (int.TryParse(strMsg, out intData))
- {
- pubnub.Publish<string>(channel, strMsg, DisplayReturnMessage);
- }
- else if (double.TryParse(strMsg, out doubleData))
- {
- pubnub.Publish<string>(channel, strMsg, DisplayReturnMessage);
- }
- else
- {
- pubnub.Publish<string>(channel, publishMsg, DisplayReturnMessage);
- }
- }
- else
- {
- pubnub.Publish<string>(channel, publishMsg, DisplayReturnMessage);
- }
- }
- break;
- case "4":
- Console.WriteLine("Running presence()");
- pubnub.Presence<string>(channel, DisplayReturnMessage);
- break;
- case "5":
- Console.WriteLine("Running detailed history()");
- pubnub.DetailedHistory<string>(channel, 100, DisplayReturnMessage);
- break;
- case "6":
- Console.WriteLine("Running Here_Now()");
- pubnub.HereNow<string>(channel, DisplayReturnMessage);
- break;
- case "7":
- Console.WriteLine("Running unsubscribe()");
- pubnub.Unsubscribe<string>(channel, DisplayReturnMessage);
- break;
- case "8":
- Console.WriteLine("Running presence-unsubscribe()");
- pubnub.PresenceUnsubscribe<string>(channel, DisplayReturnMessage);
- break;
- case "9":
- Console.WriteLine("Running time()");
- pubnub.Time<string>(DisplayReturnMessage);
- break;
- default:
- Console.WriteLine("INVALID CHOICE.");
- break;
- }
- }
-
- Console.WriteLine("\nPress any key to exit.\n\n");
- Console.ReadLine();
-
- }
-
- /// <summary>
- /// Callback method captures the response in JSON string format for all operations
- /// </summary>
- /// <param name="result"></param>
- static void DisplayReturnMessage(string result)
- {
- Console.WriteLine(result);
- }
-
- /// <summary>
- /// Callback method to provide the connect status of Subscribe call
- /// </summary>
- /// <param name="result"></param>
- static void DisplayConnectStatusMessage(string result)
- {
- Console.WriteLine(result);
- }
- }
-}
-
View
21 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Console/app.config
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
- <appSettings>
- <add key="PubnubMessaging.LogLevel" value="3"/>
- </appSettings>
- <system.diagnostics>
- <trace autoflush="true" indentsize="4">
- <listeners>
- <add name="pubnubListener"
- type="System.Diagnostics.TextWriterTraceListener"
- initializeData="pubnub-messaging.log"/>
- <remove name="Default" />
- </listeners>
- </trace>
- </system.diagnostics>
- <system.net>
- <connectionManagement>
- <add address="*" maxconnection="30" />
- </connectionManagement>
- </system.net>
-</configuration>
View
31 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Messaging.sln
@@ -1,31 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PubNub-Messaging", "PubNub-Console\PubNub-Messaging.csproj", "{9A973E1B-A9F2-400F-A5DE-C95C085A50EC}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PubNub-Messaging.Tests", "PubNubTest\PubNub-Messaging.Tests.csproj", "{255601CE-AEDB-4634-912D-68C0A3C30308}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x86 = Debug|x86
- Release|x86 = Release|x86
- AppStore|x86 = AppStore|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {255601CE-AEDB-4634-912D-68C0A3C30308}.AppStore|x86.ActiveCfg = Debug|Any CPU
- {255601CE-AEDB-4634-912D-68C0A3C30308}.AppStore|x86.Build.0 = Debug|Any CPU
- {255601CE-AEDB-4634-912D-68C0A3C30308}.Debug|x86.ActiveCfg = Debug|Any CPU
- {255601CE-AEDB-4634-912D-68C0A3C30308}.Debug|x86.Build.0 = Debug|Any CPU
- {255601CE-AEDB-4634-912D-68C0A3C30308}.Release|x86.ActiveCfg = Release|Any CPU
- {255601CE-AEDB-4634-912D-68C0A3C30308}.Release|x86.Build.0 = Release|Any CPU
- {9A973E1B-A9F2-400F-A5DE-C95C085A50EC}.AppStore|x86.ActiveCfg = Debug|x86
- {9A973E1B-A9F2-400F-A5DE-C95C085A50EC}.AppStore|x86.Build.0 = Debug|x86
- {9A973E1B-A9F2-400F-A5DE-C95C085A50EC}.Debug|x86.ActiveCfg = Debug|x86
- {9A973E1B-A9F2-400F-A5DE-C95C085A50EC}.Debug|x86.Build.0 = Debug|x86
- {9A973E1B-A9F2-400F-A5DE-C95C085A50EC}.Release|x86.ActiveCfg = Release|x86
- {9A973E1B-A9F2-400F-A5DE-C95C085A50EC}.Release|x86.Build.0 = Release|x86
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- StartupItem = PubNub-Console\PubNub-Messaging.csproj
- EndGlobalSection
-EndGlobal
View
61 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNub-Messaging.userprefs
@@ -1,61 +0,0 @@
-<Properties>
- <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|x86" />
- <MonoDevelop.Ide.Workbench ActiveDocument="PubNub-Console/PubnubExample.cs">
- <Files>
- <File FileName="PubNub-Console/Pubnub.cs" Line="3500" Column="3" />
- <File FileName="PubNubTest/WhenAClientIsPresented.cs" Line="177" Column="10" />
- <File FileName="PubNubTest/PubnubUnitTest.cs" Line="533" Column="1" />
- <File FileName="PubNub-Console/PubnubExample.cs" Line="212" Column="48" />
- </Files>
- <Pads>
- <Pad Id="ProjectPad">
- <State expanded="True">
- <Node name="PubNub-Messaging" expanded="True">
- <Node name="PubnubExample.cs" selected="True" />
- </Node>
- <Node name="PubNub-Messaging.Tests" expanded="True">
- <Node name="References" expanded="True" />
- </Node>
- </State>
- </Pad>
- <Pad Id="ClassPad">
- <State expanded="True" selected="True">
- <Node name="PubNub-Messaging.Tests" expanded="True" />
- </State>
- </Pad>
- <Pad Id="MonoDevelop.Debugger.WatchPad">
- <State>
- <Value>jsonString</Value>
- <Value>netInterface.OperationalStatus</Value>
- <Value>Common.objResponse[0]</Value>
- <Value>result</Value>
- <Value>result[0]</Value>
- <Value>unicast.Count</Value>
- <Value>addrip</Value>
- <Value>connected</Value>
- <Value>ip</Value>
- <Value>ipv4</Value>
- <Value>respDic</Value>
- </State>
- </Pad>
- <Pad Id="MonoDevelop.NUnit.TestPad">
- <State expanded="True" selected="True" />
- </Pad>
- <Pad Id="ConnectionManagerPad">
- <State selected="True" />
- </Pad>
- </Pads>
- </MonoDevelop.Ide.Workbench>
- <MonoDevelop.Ide.DebuggingService.Breakpoints>
- <BreakpointStore>
- <Breakpoint file="/Volumes/Macintosh/Users/rajatkalsy/Projects/Client/ODesk/pubnub/mono-mac-new copy/3.3.0.1/PubNub-Messaging/PubNubTest/Common.cs" line="29" />
- <Breakpoint file="/Volumes/Macintosh/Users/rajatkalsy/Projects/Client/ODesk/pubnub/mono-mac-new copy/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAClientIsPresented.cs" line="162" />
- <Breakpoint file="/Volumes/Macintosh/Users/rajatkalsy/Projects/Client/ODesk/pubnub/mono-mac-new copy/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAClientIsPresented.cs" line="152" />
- <Breakpoint file="/Volumes/Macintosh/Users/rajatkalsy/Projects/Client/ODesk/pubnub/mono-mac-new copy/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAClientIsPresented.cs" line="36" />
- </BreakpointStore>
- </MonoDevelop.Ide.DebuggingService.Breakpoints>
- <MonoDevelop.Ide.DebuggingService.PinnedWatches>
- <Watch file="PubNub-Messaging/Pubnub.cs" line="549" offsetX="648" offsetY="6960" expression="result" liveUpdate="False" />
- <Watch file="PubNub-Console/Pubnub.cs" line="2838" offsetX="591" offsetY="45392" expression="netInterface" liveUpdate="False" />
- </MonoDevelop.Ide.DebuggingService.PinnedWatches>
-</Properties>
View
27 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/AssemblyInfo.cs
@@ -1,27 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("PubNubMessaging.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("PubSub")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("1.0.*")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
-
View
45 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/Common.cs
@@ -1,45 +0,0 @@
-using System;
-using PubNubMessaging.Core;
-using System.Collections.Generic;
-using System.ComponentModel;
-
-namespace PubNubMessaging.Tests
-{
- public class Common
- {
- 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)
- {
- //deliveryStatus = true;
- //response = result;
- }
-
- public void DisplayReturnMessage(object result)
- {
- DeliveryStatus = true;
- Response = result;
- }
-
- public long Timestamp(Pubnub pubnub)
- {
- DeliveryStatus = false;
-
- pubnub.Time(DisplayReturnMessage);
- while (!DeliveryStatus) ;
-
- IList<object> fields = Response as IList<object>;
- return Convert.ToInt64(fields[0].ToString());
- }
- }
-}
-
View
473 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/EncryptionTests.cs
@@ -1,473 +0,0 @@
-using System;
-using PubNubMessaging.Core;
-using NUnit.Framework;
-using System.ComponentModel;
-using System.Collections.Generic;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Globalization;
-using Newtonsoft.Json;
-
-namespace PubNubMessaging.Tests
-{
- [TestFixture]
- public class EncryptionTests
- {
- /// <summary>
- /// Tests the yay decryption.
- /// Assumes that the input message is deserialized
- /// Decrypted string should match yay!
- /// </summary>
- [Test]
- public void TestYayDecryptionBasic ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- string message= "q/xJqqN6qbiZMXYmiQC1Fw==";
- //decrypt
- string decrypted = pubnubCrypto.Decrypt(message);
-
- Assert.AreEqual("yay!", decrypted);
- }
- /// <summary>
- /// Tests the yay encryption.
- /// The output is not serialized
- /// Encrypted string should match q/xJqqN6qbiZMXYmiQC1Fw==
- /// </summary>
- [Test]
- public void TestYayEncryptionBasic ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //deserialized string
- string message= "yay!";
- //Encrypt
- string encrypted= pubnubCrypto.Encrypt(message);
- Assert.AreEqual("q/xJqqN6qbiZMXYmiQC1Fw==", encrypted);
- }
- /// <summary>
- /// Tests the yay decryption.
- /// Assumes that the input message is not deserialized
- /// Decrypted and Deserialized string should match yay!
- /// </summary>
- [Test]
- public void TestYayDecryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //Non deserialized string
- string message= "\"Wi24KS4pcTzvyuGOHubiXg==\"";
- //Deserialize
- message= JsonConvert.DeserializeObject<string>(message);
- //decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
- //deserialize again
- message= JsonConvert.DeserializeObject<string>(decrypted);
- Assert.AreEqual("yay!", message);
- }
- /// <summary>
- /// Tests the yay encryption.
- /// The output is not serialized
- /// Encrypted string should match Wi24KS4pcTzvyuGOHubiXg==
- /// </summary>
- [Test]
- public void TestYayEncryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //deserialized string
- string message= "yay!";
- //serialize the string
- message= JsonConvert.SerializeObject(message);
- Console.WriteLine(message);
- //Encrypt
- string encrypted= pubnubCrypto.Encrypt(message);
- Assert.AreEqual("Wi24KS4pcTzvyuGOHubiXg==", encrypted);
- }
-
- /// <summary>
- /// Tests the array encryption.
- /// The output is not serialized
- /// Encrypted string should match the serialized object
- /// </summary>
- [Test]
- public void TestArrayEncryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //create an empty array object
- object [] objArr = {};
- string strArr = JsonConvert.SerializeObject(objArr);
- //Encrypt
- string encrypted= pubnubCrypto.Encrypt(strArr);
-
- Assert.AreEqual("Ns4TB41JjT2NCXaGLWSPAQ==", encrypted);
- }
-
- /// <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>
- [Test]
- public void TestArrayDecryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //Input the deserialized string
- string message= "Ns4TB41JjT2NCXaGLWSPAQ==";
- //decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
- //create a serialized object
- object [] objArr = {};
- string result= JsonConvert.SerializeObject(objArr);
- //compare the serialized object and the return of the Decrypt method
- Assert.AreEqual(result, decrypted);
- }
-
- /// <summary>
- /// Tests the object encryption.
- /// The output is not serialized
- /// Encrypted string should match the serialized object
- /// </summary>
- [Test]
- public void TestObjectEncryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //create an object
- Object obj = new Object();
- //serialize
- string strObj = JsonConvert.SerializeObject(obj);
- //encrypt
- string encrypted= pubnubCrypto.Encrypt(strObj);
-
- Assert.AreEqual("IDjZE9BHSjcX67RddfCYYg==", encrypted);
- }
- /// <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>
- [Test]
- public void TestObjectDecryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //Deserialized
- string message= "IDjZE9BHSjcX67RddfCYYg==";
- //Decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
- //create an object
- Object obj = new Object();
- //Serialize the object
- string result= JsonConvert.SerializeObject(obj);
-
- Assert.AreEqual(decrypted, result);
- }
- /// <summary>
- /// Tests my object encryption.
- /// The output is not serialized
- /// Encrypted string should match the serialized object
- /// </summary>
- [Test]
- public void TestMyObjectEncryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //create an object of the custom class
- CustomClass cc = new CustomClass();
- //serialize it
- string result= JsonConvert.SerializeObject(cc);
- //encrypt it
- string encrypted= pubnubCrypto.Encrypt(result);
-
- Assert.AreEqual("Zbr7pEF/GFGKj1rOstp0tWzA4nwJXEfj+ezLtAr8qqE=", encrypted);
- }
- /// <summary>
- /// Tests my object decryption.
- /// The output is not deserialized
- /// Decrypted string should match the serialized object
- /// </summary>
- [Test]
- public void TestMyObjectDecryption()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //Deserialized
- string message= "Zbr7pEF/GFGKj1rOstp0tWzA4nwJXEfj+ezLtAr8qqE=";
- //Decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
- //create an object of the custom class
- CustomClass cc = new CustomClass();
- //Serialize it
- string result= JsonConvert.SerializeObject(cc);
-
- Assert.AreEqual(decrypted, result);
- }
-
- /// <summary>
- /// Tests the pub nub encryption2.
- /// The output is not serialized
- /// Encrypted string should match f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=
- /// </summary>
- [Test]
- public void TestPubNubEncryption2 ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //Deserialized
- string message= "Pubnub Messaging API 2";
- //serialize the message
- message= JsonConvert.SerializeObject(message);
- //encrypt
- string encrypted= pubnubCrypto.Encrypt(message);
-
- Assert.AreEqual("f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=", encrypted);
- }
-
- /// <summary>
- /// Tests the pub nub decryption2.
- /// Assumes that the input message is deserialized
- /// Decrypted and Deserialized string should match Pubnub Messaging API 2
- /// </summary>
- [Test]
- public void TestPubNubDecryption2 ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //Deserialized string
- string message= "f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=";
- //Decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
- //Deserialize
- message= JsonConvert.DeserializeObject<string>(decrypted);
- Assert.AreEqual("Pubnub Messaging API 2", message);
- }
-
- /// <summary>
- /// Tests the pub nub encryption1.
- /// The input is not serialized
- /// Encrypted string should match f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=
- /// </summary>
- [Test]
- public void TestPubNubEncryption1 ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //non serialized string
- string message= "Pubnub Messaging API 1";
- //serialize
- message= JsonConvert.SerializeObject(message);
- //encrypt
- string encrypted= pubnubCrypto.Encrypt(message);
-
- Assert.AreEqual("f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=", encrypted);
- }
-
- /// <summary>
- /// Tests the pub nub decryption1.
- /// Assumes that the input message is deserialized
- /// Decrypted and Deserialized string should match Pubnub Messaging API 1
- /// </summary>
- [Test]
- public void TestPubNubDecryption1 ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //deserialized string
- string message= "f42pIQcWZ9zbTbH8cyLwByD/GsviOE0vcREIEVPARR0=";
- //decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
- //deserialize
- message= JsonConvert.DeserializeObject<string>(decrypted);
- Assert.AreEqual("Pubnub Messaging API 1", message);
- }
-
- /// <summary>
- /// Tests the stuff can encryption.
- /// The input is serialized
- /// Encrypted string should match zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF
- /// </summary>
- [Test]
- public void TestStuffCanEncryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //input serialized string
- string message= "{\"this stuff\":{\"can get\":\"complicated!\"}}";
- //encrypt
- string encrypted= pubnubCrypto.Encrypt(message);
-
- Assert.AreEqual("zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF", encrypted);
- }
-
- /// <summary>
- /// Tests the stuffcan decryption.
- /// Assumes that the input message is deserialized
- /// </summary>
- [Test]
- public void TestStuffcanDecryption()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //deserialized string
- string message= "zMqH/RTPlC8yrAZ2UhpEgLKUVzkMI2cikiaVg30AyUu7B6J0FLqCazRzDOmrsFsF";
- //decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
-
- Assert.AreEqual("{\"this stuff\":{\"can get\":\"complicated!\"}}", decrypted);
- }
-
- /// <summary>
- /// Tests the hash encryption.
- /// The input is serialized
- /// Encrypted string should match GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g=
- /// </summary>
- [Test]
- public void TestHashEncryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //serialized string
- string message= "{\"foo\":{\"bar\":\"foobar\"}}";
- //encrypt
- string encrypted= pubnubCrypto.Encrypt(message);
-
- Assert.AreEqual("GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g=", encrypted);
- }
-
- /// <summary>
- /// Tests the hash decryption.
- /// Assumes that the input message is deserialized
- /// </summary>
- [Test]
- public void TestHashDecryption()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //deserialized string
- string message= "GsvkCYZoYylL5a7/DKhysDjNbwn+BtBtHj2CvzC4Y4g=";
- //decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
-
- Assert.AreEqual("{\"foo\":{\"bar\":\"foobar\"}}", decrypted);
- }
-
- /// <summary>
- /// Tests the null encryption.
- /// The input is serialized
- /// </summary>
- [Test]
- [ExpectedException(typeof(ArgumentNullException))]
- public void TestNullEncryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //serialized string
- string message= null;
- //encrypt
- string encrypted= pubnubCrypto.Encrypt(message);
-
- Assert.AreEqual("", encrypted);
- }
-
- /// <summary>
- /// Tests the null decryption.
- /// Assumes that the input message is deserialized
- /// </summary>
- [Test]
- [ExpectedException(typeof(ArgumentNullException))]
- public void TestNullDecryption()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- //deserialized string
- string message= null;
- //decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
-
- Assert.AreEqual("", decrypted);
- }
- /// <summary>
- /// Tests the unicode chars encryption.
- /// The input is not serialized
- /// </summary>
- [Test]
- public void TestUnicodeCharsEncryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- string message= "漢語";
- message= JsonConvert.SerializeObject(message);
- Console.WriteLine(message);
- string encrypted= pubnubCrypto.Encrypt(message);
- Console.WriteLine(encrypted);
- Assert.AreEqual("+BY5/miAA8aeuhVl4d13Kg==", encrypted);
- }
- /// <summary>
- /// Tests the unicode decryption.
- /// Assumes that the input message is deserialized
- /// Decrypted and Deserialized string should match the unicode chars
- /// </summary>
- [Test]
- public void TestUnicodeCharsDecryption()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- string message= "+BY5/miAA8aeuhVl4d13Kg==";
- //decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
- //deserialize
- message= JsonConvert.DeserializeObject<string>(decrypted);
-
- Assert.AreEqual("漢語", message);
- }
- /// <summary>
- /// Tests the german chars decryption.
- /// Assumes that the input message is deserialized
- /// Decrypted and Deserialized string should match the unicode chars
- /// </summary>
- [Test]
- public void TestGermanCharsDecryption()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- string message= "stpgsG1DZZxb44J7mFNSzg==";
- //decrypt
- string decrypted= pubnubCrypto.Decrypt(message);
- //deserialize
- message= JsonConvert.DeserializeObject<string>(decrypted);
-
- Assert.AreEqual("ÜÖ", message);
- }
- /// <summary>
- /// Tests the german encryption.
- /// The input is not serialized
- /// </summary>
- [Test]
- public void TestGermanCharsEncryption ()
- {
- PubnubCrypto pubnubCrypto = new PubnubCrypto("enigma");
- string message= "ÜÖ";
- message= JsonConvert.SerializeObject(message);
- Console.WriteLine(message);
- string encrypted= pubnubCrypto.Encrypt(message);
- Console.WriteLine(encrypted);
- Assert.AreEqual("stpgsG1DZZxb44J7mFNSzg==", encrypted);
- }
-
- static string EncodeNonAsciiCharacters( string value ) {
- StringBuilder encodedString = new StringBuilder();
- foreach( char c in value ) {
- if( c > 127 ) {
- // This character is too big for ASCII
- string encodedValue = "\\u" + ((int) c).ToString( "x4" );
- encodedString.Append( encodedValue );
- }
- else {
- encodedString.Append( c );
- }
- }
- return encodedString.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();
- } );
- }
- }
-
- /// <summary>
- /// Custom class for testing the encryption and decryption
- /// </summary>
- class CustomClass
- {
- public string foo = "hi!";
- public int [] bar = {1, 2, 3, 4, 5};
- }
-}
-
View
74 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/PubNub-Messaging.Tests.csproj
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>10.0.0</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{255601CE-AEDB-4634-912D-68C0A3C30308}</ProjectGuid>
- <OutputType>Library</OutputType>
- <RootNamespace>PubNubTest</RootNamespace>
- <AssemblyName>PubNubTest</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>True</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>False</Optimize>
- <OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>False</ConsolePause>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>none</DebugType>
- <Optimize>True</Optimize>
- <OutputPath>bin\Release</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>False</ConsolePause>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="nunit.framework, Version=2.6.0.12051, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <Private>False</Private>
- </Reference>
- <Reference Include="System.Core" />
- <Reference Include="System.Web.Extensions" />
- <Reference Include="Newtonsoft.Json">
- <HintPath>..\PubNub-Console\Library\Newtonsoft.Json.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="AssemblyInfo.cs" />
- <Compile Include="WhenAMessageIsPublished.cs" />
- <Compile Include="EncryptionTests.cs" />
- <Compile Include="WhenDetailedHistoryIsRequested.cs" />
- <Compile Include="WhenGetRequestServerTime.cs" />
- <Compile Include="WhenSubscribedToAChannel.cs" />
- <Compile Include="WhenAClientIsPresented.cs" />
- <Compile Include="Common.cs" />
- <Compile Include="PubnubUnitTest.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <ProjectExtensions>
- <MonoDevelop>
- <Properties>
- <Policies>
- <TextStylePolicy FileWidth="120" IndentWidth="2" EolMarker="Unix" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
- <CSharpFormattingPolicy IndentSwitchBody="True" StatementBraceStyle="NextLineShifted2" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
- <TextStylePolicy FileWidth="120" TabsToSpaces="False" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/plain" />
- </Policies>
- </Properties>
- </MonoDevelop>
- </ProjectExtensions>
- <ItemGroup>
- <ProjectReference Include="..\PubNub-Console\PubNub-Messaging.csproj">
- <Project>{9A973E1B-A9F2-400F-A5DE-C95C085A50EC}</Project>
- <Name>PubNub-Messaging</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-</Project>
View
532 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/PubnubUnitTest.cs
@@ -1,532 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using PubNubMessaging.Core;
-
-namespace PubNubMessaging.Tests
-{
- public class PubnubUnitTest : IPubnubUnitTest
- {
- private bool enableStubTest = true;
- private string testClassName = "";
- private string testCaseName = "";
-
- public bool EnableStubTest
- {
- get
- {
- return enableStubTest;
- }
- set
- {
- enableStubTest = value;
- }
- }
-
- private Dictionary<string, string> LoadWhenAClientIsPresentedThenPresenceShouldReturnReceivedMessageCipher()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
- data.Add("/subscribe/demo/hello_world-pnpres/0/0", "[[],\"13559007117760880\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559007117760880", "[[{\"action\": \"join\", \"timestamp\": 1355929955, \"uuid\": \"eb4c1645-1319-4425-865f-008563009d67\", \"occupancy\": 1}],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559011560379628", "[[],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world/0/0", "[[],\"13559006802662768\"]");
- data.Add("/subscribe/demo/hello_world/0/13559006802662768", "[[\"f7wNXpx8Ys8pVJNR5ZHT9g==\"],\"13559014566792816\"]");
- data.Add("/subscribe/demo/hello_world/0/13559014566792816", "[[],\"13559014566792816\"]");
- #else
- data.Add("/subscribe/demo/hello_world-pnpres/0/0", "[[],\"13559007117760880\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559007117760880", "[[{\"action\": \"join\", \"timestamp\": 1355929955, \"uuid\": \"eb4c1645-1319-4425-865f-008563009d67\", \"occupancy\": 1}],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559011560379628", "[[],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world/0/0", "[[],\"13559006802662768\"]");
- data.Add("/subscribe/demo/hello_world/0/13559006802662768", "[[\"f7wNXpx8Ys8pVJNR5ZHT9g==\"],\"13559014566792816\"]");
- data.Add("/subscribe/demo/hello_world/0/13559014566792816", "[[],\"13559014566792816\"]");
-
- #endif
- data.Add("/v2/presence/sub_key/demo/channel/hello_world/leave", "{\"action\": \"leave\"}");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAClientIsPresentedThenPresenceShouldReturnReceivedMessage()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
-#if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
- data.Add("/subscribe/demo/hello_world-pnpres/0/0", "[[],\"13559007117760880\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559007117760880", "[[{\"action\": \"join\", \"timestamp\": 1355929955, \"uuid\": \"eb4c1645-1319-4425-865f-008563009d67\", \"occupancy\": 1}],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559011560379628", "[[],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world/0/0", "[[],\"13559006802662768\"]");
- data.Add("/subscribe/demo/hello_world/0/13559006802662768", "[[\"demo test for stubs\"],\"13559014566792816\"]");
- data.Add("/subscribe/demo/hello_world/0/13559014566792816", "[[],\"13559014566792816\"]");
-#else
- data.Add("/subscribe/demo/hello_world-pnpres/0/0", "[[],\"13559007117760880\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559007117760880", "[[{\"action\": \"join\", \"timestamp\": 1355929955, \"uuid\": \"eb4c1645-1319-4425-865f-008563009d67\", \"occupancy\": 1}],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559011560379628", "[[],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world/0/0", "[[],\"13559006802662768\"]");
- data.Add("/subscribe/demo/hello_world/0/13559006802662768", "[[\"demo test for stubs\"],\"13559014566792816\"]");
- data.Add("/subscribe/demo/hello_world/0/13559014566792816", "[[],\"13559014566792816\"]");
-#endif
- data.Add("/v2/presence/sub_key/demo/channel/hello_world/leave", "{\"action\": \"leave\"}");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAClientIsPresentedIfHereNowIsCalledThenItShouldReturnInfo()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/presence/sub_key/demo/channel/hello_world", "{\"uuids\":[\"eb4c1645-1319-4425-865f-008563009d67\"],\"occupancy\":1}");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAMessageIsPublishedThenItShouldReturnSuccessCodeAndInfo()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/publish/demo/demo/0/hello_world/0/\"Pubnub API Usage Example\"", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"Pubnub API Usage Example\"],13557486057035336,13559006802662769]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAMessageIsPublishedThenUnencryptPublishShouldReturnSuccessCodeAndInfo()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/publish/demo/demo/0/hello_world/0/\"Pubnub Messaging API 1\"", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"Pubnub Messaging API 1\"],13557486057035336,13559006802662769]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAMessageIsPublishedThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/publish/demo/demo/0/hello_world/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/hello_world", "[[{\"foo\":\"hi!\",\"bar\":[1,2,3,4,5]}],13557486057035336,13559006802662769]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAMessageIsPublishedThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/publish/demo/demo/0/hello_world/0/%22nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"nQTUCOeyWWgWh5NRLhSlhIingu92WIQ6RFloD9rOZsTUjAhD7AkMaZJVgU7l28e2\"],13559215464464812,13559215464464812]");
- return data;
- }
-
-
- private Dictionary<string, string> LoadWhenAMessageIsPublishedThenEncryptPublishShouldReturnSuccessCodeAndInfo()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/publish/demo/demo/0/hello_world/0/%22%2BBY5%2FmiAA8aeuhVl4d13Kg%3D%3D%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"+BY5/miAA8aeuhVl4d13Kg==\"],13557486057035336,13559006802662769]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAMessageIsPublishedThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/publish/demo/demo/3f75435fcd800f5d0476fc0fb5b572d1/hello_world/0/%22f42pIQcWZ9zbTbH8cyLwB%2FtdvRxjFLOYcBNMVKeHS54%3D%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"f42pIQcWZ9zbTbH8cyLwB/tdvRxjFLOYcBNMVKeHS54=\"],13559191494674157,13559191494674157]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAMessageIsPublishedThenOptionalSecretKeyShouldBeProvidedInConstructor()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/publish/demo/demo/d759c756abbd45a9864adc7f2b91393e/hello_world/0/%22Pubnub%20API%20Usage%20Example%22", "[1,\"Sent\",\"13559014566792817\"]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAMessageIsPublishedIfSSLNotProvidedThenDefaultShouldBeFalse()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/publish/demo/demo/0/hello_world/0/%22Pubnub%20API%20Usage%20Example%22", "[1,\"Sent\",\"13559014566792817\"]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestEncryptedDetailedHistory()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"EyKRq4Bzi1V44Lwz9i/cZw==\",\"BIWan5yOqIz3a0hAinJJ9Q==\",\"2x9t3rbm6Jr6YcCCuWCRdQ==\",\"NmPPeaSVnChejVR44rFJ5Q==\",\"y4FSc7Y9IEEoEmtDAJO3FQ==\",\"QByvge9lb/3H008RfX+VRA==\",\"tEJ1HKlGhYklpZqZLUDQjA==\",\"XZGNx138XpiwS5aVESXuYg==\",\"ayWFXhv+qv09Gj+I/ooNQQ==\",\"4N2LhvhnPG3v3bvWuqEb0g==\"],13561926677985130,13561926705714509]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestUnencryptedDetailedHistory()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"],13561931614319981,13561931641037537]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedDetailedHistoryDecryptedExample()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"f7wNXpx8Ys8pVJNR5ZHT9g==\"],13561993102217562,13561993102217562]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedItShouldReturnDetailedHistory()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"Test message\"],13561916644576302,13561916644576302]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestEncryptedSecretDetailedHistoryParams1()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"EyKRq4Bzi1V44Lwz9i/cZw==\",\"BIWan5yOqIz3a0hAinJJ9Q==\",\"2x9t3rbm6Jr6YcCCuWCRdQ==\",\"NmPPeaSVnChejVR44rFJ5Q==\",\"y4FSc7Y9IEEoEmtDAJO3FQ==\"],13561997459447496,13561997470537187]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestEncryptedSecretDetailedHistoryParams2()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"QByvge9lb/3H008RfX+VRA==\",\"tEJ1HKlGhYklpZqZLUDQjA==\",\"XZGNx138XpiwS5aVESXuYg==\",\"ayWFXhv+qv09Gj+I/ooNQQ==\",\"4N2LhvhnPG3v3bvWuqEb0g==\"],13561997475925030,13561997486798712]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestEncryptedSecretDetailedHistoryParams3()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"EyKRq4Bzi1V44Lwz9i/cZw==\",\"BIWan5yOqIz3a0hAinJJ9Q==\",\"2x9t3rbm6Jr6YcCCuWCRdQ==\",\"NmPPeaSVnChejVR44rFJ5Q==\",\"y4FSc7Y9IEEoEmtDAJO3FQ==\"],13561997459447496,13561997470537187]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestUnencryptedSecretDetailedHistoryParams1()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"0\",\"1\",\"2\",\"3\",\"4\"],13561998607085158,13561998618677990]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestUnencryptedSecretDetailedHistoryParams2()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"5\",\"6\",\"7\",\"8\",\"9\"],13561998626205890,13561998636560986]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestUnencryptedSecretDetailedHistoryParams3()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"0\",\"1\",\"2\",\"3\",\"4\"],13561998607085158,13561998618677990]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestEncryptedDetailedHistoryParams1()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"EyKRq4Bzi1V44Lwz9i/cZw==\",\"BIWan5yOqIz3a0hAinJJ9Q==\",\"2x9t3rbm6Jr6YcCCuWCRdQ==\",\"NmPPeaSVnChejVR44rFJ5Q==\",\"y4FSc7Y9IEEoEmtDAJO3FQ==\"],13561885846793689,13561885857459163]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestEncryptedDetailedHistoryParams2()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"QByvge9lb/3H008RfX+VRA==\",\"tEJ1HKlGhYklpZqZLUDQjA==\",\"XZGNx138XpiwS5aVESXuYg==\",\"ayWFXhv+qv09Gj+I/ooNQQ==\",\"4N2LhvhnPG3v3bvWuqEb0g==\"],13561885862589838,13561885872731649]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestEncryptedDetailedHistoryParams3()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"EyKRq4Bzi1V44Lwz9i/cZw==\",\"BIWan5yOqIz3a0hAinJJ9Q==\",\"2x9t3rbm6Jr6YcCCuWCRdQ==\",\"NmPPeaSVnChejVR44rFJ5Q==\",\"y4FSc7Y9IEEoEmtDAJO3FQ==\"],13561885846793689,13561885857459163]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestUnencryptedDetailedHistoryParams1()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"0\",\"1\",\"2\",\"3\",\"4\"],13561969547888925,13561969560429174]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestUnencryptedDetailedHistoryParams2()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"5\",\"6\",\"7\",\"8\",\"9\"],13561969565962377,13561969576984085]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedTestUnencryptedDetailedHistoryParams3()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"0\",\"1\",\"2\",\"3\",\"4\"],13561969547888925,13561969560429174]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedDetailHistoryCount10ReturnsRecords()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"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]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedDetailHistoryCount10ReverseTrueReturnsRecords()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"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]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenDetailedHistoryIsRequestedDetailedHistoryStartWithReverseTrue()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/v2/history/sub-key/demo/channel/hello_world", "[[\"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/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%200%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%201%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%202%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%203%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%204%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%205%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%206%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%207%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%208%22", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/%22DetailedHistoryStartTimeWithReverseTrue%209%22", "[1,\"Sent\",\"13559014566792817\"]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenGetRequestServerTimeThenItShouldReturnTimeStamp()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/time/0", "[13559011090230537]");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenSubscribedToAChannelThenSubscribeShouldReturnReceivedMessageCipher()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/subscribe/demo/hello_world/0/0", "[[],\"13559006802662768\"]");
- data.Add("/subscribe/demo/hello_world/0/13559006802662768", "[[\"f7wNXpx8Ys8pVJNR5ZHT9g==\"],\"13559014566792816\"]");
- data.Add("/subscribe/demo/hello_world/0/13559014566792816", "[[],\"13559014566792816\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/\"f7wNXpx8Ys8pVJNR5ZHT9g==\"", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/v2/presence/sub_key/demo/channel/hello_world/leave", "{\"action\": \"leave\"}");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenSubscribedToAChannelThenSubscribeShouldReturnReceivedMessage()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/subscribe/demo/hello_world/0/0", "[[],\"13559006802662768\"]");
- data.Add("/subscribe/demo/hello_world/0/13559006802662768", "[[\"Test Message\"],\"13559014566792816\"]");
- data.Add("/subscribe/demo/hello_world/0/13559014566792816", "[[],\"13559014566792816\"]");
- data.Add("/publish/demo/demo/0/hello_world/0/\"Test Message\"", "[1,\"Sent\",\"13559014566792817\"]");
- data.Add("/v2/presence/sub_key/demo/channel/hello_world/leave", "{\"action\": \"leave\"}");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenSubscribedToAChannelThenSubscribeShouldReturnConnectStatus()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- data.Add("/subscribe/demo/hello_world/0/0", "[[],\"13559006802662768\"]");
- data.Add("/subscribe/demo/hello_world/0/13559006802662768", "[[],\"13559006802662768\"]");
- data.Add("/v2/presence/sub_key/demo/channel/hello_world/leave", "{\"action\": \"leave\"}");
- return data;
- }
-
- private Dictionary<string, string> LoadWhenAClientIsPresentedThenPresenceShouldReturnCustomUUID()
- {
- Dictionary<string, string> data = new Dictionary<string, string>();
- #if ((!__MonoCS__) && (!SILVERLIGHT) && (!WINDOWS_PHONE))
- data.Add("/subscribe/demo/hello_world-pnpres/0/0", "[[],\"13559007117760880\"]");
- data.Add("/subscribe/demo/testChannel/0/13559007117760880", "[[{\"action\": \"join\", \"timestamp\": 1355929955, \"uuid\": \"CustomSessionUUIDTest\", \"occupancy\": 1}],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559011560379628", "[[],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world/0/0", "[[],\"13559006802662768\"]");
- data.Add("/subscribe/demo/hello_world/0/13559006802662768", "[[\"f7wNXpx8Ys8pVJNR5ZHT9g==\"],\"13559014566792816\"]");
- data.Add("/subscribe/demo/hello_world/0/13559014566792816", "[[],\"13559014566792816\"]");
- #else
- data.Add("/subscribe/demo/hello_world-pnpres/0/0", "[[],\"13559007117760880\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559007117760880", "[[{\"action\": \"join\", \"timestamp\": 1355929955, \"uuid\": \"CustomSessionUUIDTest\", \"occupancy\": 1}],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world-pnpres/0/13559011560379628", "[[],\"13559011560379628\"]");
- data.Add("/subscribe/demo/hello_world/0/0", "[[],\"13559006802662768\"]");
- data.Add("/subscribe/demo/hello_world/0/13559006802662768", "[[\"demo test for stubs\"],\"13559014566792816\"]");
- data.Add("/subscribe/demo/hello_world/0/13559014566792816", "[[],\"13559014566792816\"]");
- #endif
- data.Add("/v2/presence/sub_key/demo/channel/hello_world/leave", "{\"action\": \"leave\"}");
- return data;
- }
-
- public string GetStubResponse(Uri request)
- {
- Dictionary<string,string> responseDictionary = null;
- string response = "!! Stub Response Not Assigned !!";
-
- //string lookUpString = request.PathAndQuery;
-
- switch (testClassName)
- {
- case "WhenAClientIsPresented":
- switch (testCaseName)
- {
- case "ThenPresenceShouldReturnReceivedMessage":
- responseDictionary = LoadWhenAClientIsPresentedThenPresenceShouldReturnReceivedMessage();
- break;
- case "ThenPresenceShouldReturnReceivedMessageCipher":
- responseDictionary = LoadWhenAClientIsPresentedThenPresenceShouldReturnReceivedMessageCipher();
- break;
- case "IfHereNowIsCalledThenItShouldReturnInfo":
- responseDictionary = LoadWhenAClientIsPresentedIfHereNowIsCalledThenItShouldReturnInfo();
- break;
- case "ThenPresenceShouldReturnCustomUUID":
- responseDictionary = LoadWhenAClientIsPresentedThenPresenceShouldReturnCustomUUID();
- break;
- default:
- break;
- }
- break;
- case "WhenAMessageIsPublished":
- switch (testCaseName)
- {
- case "ThenItShouldReturnSuccessCodeAndInfo":
- responseDictionary = LoadWhenAMessageIsPublishedThenItShouldReturnSuccessCodeAndInfo();
- break;
- case "ThenUnencryptPublishShouldReturnSuccessCodeAndInfo":
- responseDictionary = LoadWhenAMessageIsPublishedThenUnencryptPublishShouldReturnSuccessCodeAndInfo();
- break;
- case "ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo":
- responseDictionary = LoadWhenAMessageIsPublishedThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo();
- break;
- case "ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo":
- responseDictionary = LoadWhenAMessageIsPublishedThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo();
- break;
- case "ThenEncryptPublishShouldReturnSuccessCodeAndInfo":
- responseDictionary = LoadWhenAMessageIsPublishedThenEncryptPublishShouldReturnSuccessCodeAndInfo();
- break;
- case "ThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo":
- responseDictionary = LoadWhenAMessageIsPublishedThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo();
- break;
- case "ThenOptionalSecretKeyShouldBeProvidedInConstructor":
- responseDictionary = LoadWhenAMessageIsPublishedThenOptionalSecretKeyShouldBeProvidedInConstructor();
- break;
- case "IfSSLNotProvidedThenDefaultShouldBeFalse":
- responseDictionary = LoadWhenAMessageIsPublishedIfSSLNotProvidedThenDefaultShouldBeFalse();
- break;
- default:
- break;
- }
- break;
- case "WhenDetailedHistoryIsRequested":
- switch (testCaseName)
- {
-
- case "DetailedHistoryDecryptedExample":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedDetailedHistoryDecryptedExample();
- break;
- case "TestUnencryptedSecretDetailedHistoryParams1":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestUnencryptedSecretDetailedHistoryParams1();
- break;
- case "TestUnencryptedSecretDetailedHistoryParams2":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestUnencryptedSecretDetailedHistoryParams2();
- break;
- case "TestUnencryptedSecretDetailedHistoryParams3":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestUnencryptedSecretDetailedHistoryParams3();
- break;
- case "TestEncryptedSecretDetailedHistoryParams1":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestEncryptedSecretDetailedHistoryParams1();
- break;
- case "TestEncryptedSecretDetailedHistoryParams2":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestEncryptedSecretDetailedHistoryParams2();
- break;
- case "TestEncryptedSecretDetailedHistoryParams3":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestEncryptedSecretDetailedHistoryParams3();
- break;
- case "TestUnencryptedDetailedHistoryParams1":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestUnencryptedDetailedHistoryParams1();
- break;
- case "TestUnencryptedDetailedHistoryParams2":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestUnencryptedDetailedHistoryParams2();
- break;
- case "TestUnencryptedDetailedHistoryParams3":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestUnencryptedDetailedHistoryParams3();
- break;
- case "TestEncryptedDetailedHistory":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestEncryptedDetailedHistory();
- break;
- case "TestUnencryptedDetailedHistory":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestUnencryptedDetailedHistory();
- break;
- case "ItShouldReturnDetailedHistory":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedItShouldReturnDetailedHistory();
- break;
- case "TestEncryptedDetailedHistoryParams1":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestEncryptedDetailedHistoryParams1();
- break;
- case "TestEncryptedDetailedHistoryParams2":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestEncryptedDetailedHistoryParams2();
- break;
- case "TestEncryptedDetailedHistoryParams3":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedTestEncryptedDetailedHistoryParams3();
- break;
- case "DetailHistoryCount10ReturnsRecords":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedDetailHistoryCount10ReturnsRecords();
- break;
- case "DetailHistoryCount10ReverseTrueReturnsRecords":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedDetailHistoryCount10ReverseTrueReturnsRecords();
- break;
- case "DetailedHistoryStartWithReverseTrue":
- responseDictionary = LoadWhenDetailedHistoryIsRequestedDetailedHistoryStartWithReverseTrue();
- break;
- default:
- break;
- }
- break;
- case "WhenGetRequestServerTime":
- switch (testCaseName)
- {
- case "ThenItShouldReturnTimeStamp":
- responseDictionary = LoadWhenGetRequestServerTimeThenItShouldReturnTimeStamp();
- break;
- default:
- break;
- }
- break;
- case "WhenSubscribedToAChannel":
- switch (testCaseName)
- {
- case "ThenSubscribeShouldReturnReceivedMessageCipher":
- responseDictionary = LoadWhenSubscribedToAChannelThenSubscribeShouldReturnReceivedMessageCipher();
- break;
- case "ThenSubscribeShouldReturnReceivedMessage":
- responseDictionary = LoadWhenSubscribedToAChannelThenSubscribeShouldReturnReceivedMessage();
- break;
- case "ThenSubscribeShouldReturnConnectStatus":
- responseDictionary = LoadWhenSubscribedToAChannelThenSubscribeShouldReturnConnectStatus();
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
-
- if (responseDictionary != null && responseDictionary.ContainsKey(request.LocalPath))
- {
- response = responseDictionary[request.LocalPath];
- }
-
- return response;
- }
-
- public string TestCaseName
- {
- get
- {
- return testCaseName;
- }
- set
- {
- testCaseName = value;
- }
- }
-
-
- public string TestClassName
- {
- get
- {
- return testClassName;
- }
- set
- {
- testClassName = value;
- }
- }
- }
-}
View
180 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAClientIsPresented.cs
@@ -1,180 +0,0 @@
-using System;
-using PubNubMessaging.Core;
-using NUnit.Framework;
-using System.ComponentModel;
-using System.Collections.Generic;
-
-
-namespace PubNubMessaging.Tests
-{
- [TestFixture]
- public class WhenAClientIsPresented
- {
- [Test]
- public void ThenItShouldReturnReceivedMessage()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false
- );
- string channel = "hello_world";
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenAClientIsPresented", "ThenPresenceShouldReturnReceivedMessage");
-
- pubnub.Presence(channel, common.DisplayReturnMessage);
- //while (!cm.deliveryStatus) ;
- //cm.response = null;
- pubnub.Subscribe(channel, common.DisplayReturnMessageDummy);
- while (!common.DeliveryStatus) ;
-
- string response = "";
- if (common.Response.Equals (null)) {
- Assert.Fail("Null response");
- }
- else
- {
- IList<object> responseFields = common.Response as IList<object>;
- foreach (object item in responseFields)
- {
- response = item.ToString();
- Console.WriteLine("Response:" + response);
- //Assert.IsNotEmpty(strResponse);
- }
- Assert.AreEqual("hello_world", responseFields[2]);
- }
- }
-
- [Test]
- public void IfHereNowIsCalledThenItShouldReturnInfo()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false
- );
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- HereNow(pubnub, "IfHereNowIsCalledThenItShouldReturnInfo", common.DisplayReturnMessage);
- while (!common.DeliveryStatus) ;
-
- ParseResponse(common.Response);
- }
-
- void HereNow(Pubnub pubnub, string unitTestCaseName,
- Action<object> userCallback)
- {
- string channel = "hello_world";
-
- PubnubUnitTest unitTest = new PubnubUnitTest();
- unitTest.TestClassName = "WhenAClientIsPresented";
- unitTest.TestCaseName = unitTestCaseName;
- pubnub.PubnubUnitTest = unitTest;
-
- pubnub.HereNow(channel, userCallback);
- }
-
- public void ParseResponse(object commonResponse)
- {
- string response = "";
- if (commonResponse.Equals (null)) {
- Assert.Fail("Null response");
- }
- else
- {
- IList<object> responseFields = commonResponse as IList<object>;
- foreach(object item in responseFields)
- {
- response = item.ToString();
- Console.WriteLine("Response:" + response);
- Assert.IsNotEmpty(response);
- }
- Dictionary<string, object> message = (Dictionary<string, object>)responseFields[0];
- foreach(KeyValuePair<String, object> entry in message)
- {
- Console.WriteLine("value:" + entry.Value + " " + "key:" + entry.Key);
- }
-
- /*object[] objUuid = (object[])message["uuids"];
- foreach (object obj in objUuid)
- {
- Console.WriteLine(obj.ToString());
- }*/
- //Assert.AreNotEqual(0, message["occupancy"]);
- }
- }
-
- [Test]
- public void IfHereNowIsCalledWithCipherThenItShouldReturnInfo()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "enigma",
- false
- );
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- HereNow(pubnub, "IfHereNowIsCalledThenItShouldReturnInfo", common.DisplayReturnMessage);
- while (!common.DeliveryStatus) ;
-
- ParseResponse(common.Response);
- }
-
- [Test]
- public void ThenPresenceShouldReturnCustomUUID()
- {
- Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
-
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenAClientIsPresented", "ThenPresenceShouldReturnCustomUUID");;
- pubnub.SessionUUID = "CustomSessionUUIDTest";
-
- string channel = "hello_world";
-
- pubnub.Presence(channel, common.DisplayReturnMessage);
-
- pubnub.Subscribe(channel, common.DisplayReturnMessageDummy);
-
- while (!common.DeliveryStatus) ;
-
- string response = "";
- if (common.Response.Equals (null)) {
- Assert.Fail("Null response");
- }
- else
- {
- IList<object> responseFields = common.Response as IList<object>;
- if(responseFields != null)
- {
- foreach (object item in responseFields)
- {
- response = item.ToString();
- Console.WriteLine("Response:" + response);
- }
- Assert.True((responseFields[0].ToString()).Contains(pubnub.SessionUUID));
- }
- else
- {
- Assert.Fail("null response");
- }
- }
- }
- }
-}
-
View
175 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenAMessageIsPublished.cs
@@ -1,175 +0,0 @@
-using System;
-using PubNubMessaging.Core;
-using NUnit.Framework;
-using System.ComponentModel;
-using System.Collections.Generic;
-
-
-namespace PubNubMessaging.Tests
-{
- [TestFixture]
- public class WhenAMessageIsPublished
- {
- public void NullMessage()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false
- );
- string channel = "hello_world";
- string message = null;
-
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- pubnub.Publish(channel, message, common.DisplayReturnMessage);
- //wait till the response is received from the server
- while (!common.DeliveryStatus) ;
- IList<object> fields = common.Response as IList<object>;
- string sent = fields[1].ToString();
- string one = fields[0].ToString();
- Assert.AreEqual("Sent", sent);
- Assert.AreEqual("1", one);
- }
-
- [Test]
- public void ThenItShouldReturnSuccessCodeAndInfo()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false
- );
- string channel = "hello_world";
- string message = "Pubnub API Usage Example";
-
- Common common = new Common();
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenAMessageIsPublished", "ThenItShouldReturnSuccessCodeAndInfo");
-
- common.DeliveryStatus = false;
- common.Response = null;
-
- pubnub.Publish(channel, message, common.DisplayReturnMessage);
- //wait till the response is received from the server
- while (!common.DeliveryStatus) ;
- IList<object> fields = common.Response as IList<object>;
- string sent = fields[1].ToString();
- string one = fields[0].ToString();
- Assert.AreEqual("Sent", sent);
- Assert.AreEqual("1", one);
- }
-
- [Test]
- public void ThenItShouldGenerateUniqueIdentifier()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false
- );
-
- Assert.IsNotNull(pubnub.GenerateGuid());
- }
-
- [Test]
- public void ThenPublishKeyShouldBeOverriden()
- {
- Pubnub pubnub = new Pubnub(
- "",
- "demo",
- "",
- "",
- false
- );
- string channel = "mychannel";
- string message = "Pubnub API Usage Example";
-
- pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false
- );
- Common common = new Common();
- Assert.AreEqual(true, pubnub.Publish(channel, message, common.DisplayReturnMessage));
- }
-
- [Test]
- [ExpectedException(typeof(MissingFieldException))]
- public void ThenPublishKeyShouldNotBeEmptyAfterOverriden()
- {
- Pubnub pubnub = new Pubnub(
- "",
- "demo",
- "",
- "",
- false
- );
- string channel = "mychannel";
- string message = "Pubnub API Usage Example";
- Common common = new Common();
- Assert.AreEqual(false, pubnub.Publish(channel, message, common.DisplayReturnMessage));
- }
-
- [Test]
- public void ThenSecretKeyShouldBeProvidedOptionally()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo"
- );
- string channel = "mychannel";
- string message = "Pubnub API Usage Example";
- Common common = new Common();
- Assert.AreEqual(true, pubnub.Publish(channel, message, common.DisplayReturnMessage));
- pubnub = new Pubnub(
- "demo",
- "demo",
- "key"
- );
- Assert.AreEqual(true, pubnub.Publish(channel, message, common.DisplayReturnMessage));
- }
-
- [Test]
- public void IfSSLNotProvidedThenDefaultShouldBeFalse()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- ""
- );
- string channel = "hello_world";
- string message = "Pubnub API Usage Example";
- Common common = new Common();
- Assert.AreEqual(true, pubnub.Publish(channel, message, common.DisplayReturnMessage));
- }
-
- [Test]
- [ExpectedException(typeof(MissingFieldException))]
- public void NullShouldBeTreatedAsEmpty()
- {
- Pubnub pubnub = new Pubnub(
- null,
- "demo",
- null,
- null,
- false
- );
- string channel = "mychannel";
- string message = "Pubnub API Usage Example";
- Common common = new Common();
- Assert.AreEqual(false, pubnub.Publish(channel, message, common.DisplayReturnMessage));
- }
- }
-}
-
View
537 mono-for-mac/3.3.0.1/PubNub-Messaging/PubNubTest/WhenDetailedHistoryIsRequested.cs
@@ -1,537 +0,0 @@
-using System;
-using NUnit.Framework;
-using System.ComponentModel;
-using System.Collections.Generic;
-using System.Linq;
-using System.Collections;
-using PubNubMessaging.Core;
-
-namespace PubNubMessaging.Tests
-{
- [TestFixture]
- public class WhenDetailedHistoryIsRequested
- {
- [Test]
- public void ItShouldReturnDetailedHistory()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false
- );
- string channel = "hello_world";
- string message = "Test message";
-
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"ItShouldReturnDetailedHistory");
-
- //publish a test message.
- pubnub.Publish(channel, message, common.DisplayReturnMessage);
-
- while (!common.DeliveryStatus);
-
- common.DeliveryStatus = false;
- common.Response = null;
- pubnub.DetailedHistory(channel, 1, common.DisplayReturnMessage);
- while (!common.DeliveryStatus);
-
- ParseResponse(common.Response, 0, 0, message);
- }
-
- public void SendMultipleIntMessages(int messageStart, int messageEnd, string channel, Pubnub pubnub)
- {
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- for (int i = messageStart; i < messageEnd; i++)
- {
- common.DeliveryStatus = false;
- string msg = i.ToString();
- pubnub.Publish(channel, msg, common.DisplayReturnMessage);
-
- while (!common.DeliveryStatus) ;
-
- Console.WriteLine("Message # " + i.ToString() + " published");
- }
- }
-
- public void ParseResponse(object commonResponse, int messageStart, int messageEnd, string message)
- {
- if (commonResponse.Equals(null))
- {
- Assert.Fail("Null response");
- }
- else
- {
- IList<object> fields = commonResponse as IList<object>;
-
- if (fields [0] != null)
- {
- ParseFields(fields, messageStart, messageEnd, message);
- }
- }
- }
-
- public void ParseFields(IList<object> fields, int messageStart, int messageEnd, string message)
- {
- string response = "";
-
- var myObjectArray = (from item in fields select item as object).ToArray();
- IList<object> enumerable = myObjectArray [0] as IList<object>;
- if ((enumerable != null) && (enumerable.Count > 0))
- {
- int j = messageStart;
- foreach (object element in enumerable)
- {
- response = element.ToString();
- if(messageStart != messageEnd)
- {
- Console.WriteLine(String.Format("response :{0} :: j: {1}", response, j));
- if(j < messageEnd)
- Assert.AreEqual(j.ToString(), response);
- j++;
- }
- else if(!message.Equals(""))
- {
- Console.WriteLine("Response:" + response);
- Assert.AreEqual(message, response);
- }
- else
- {
- Console.WriteLine("Response:" + response);
- Assert.IsNotEmpty(response);
- }
- }
- }
- else
- {
- Assert.Fail("No response");
- }
- }
-
- [Test]
- public void TestUnencryptedDetailedHistoryParams()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false);
-
- string channel = "hello_world";
-
- int totalMessages = 10;
-
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- long starttime = common.Timestamp(pubnub);
-
- SendMultipleIntMessages(0, totalMessages/2, channel, pubnub);
-
- long midtime = common.Timestamp(pubnub);
-
- SendMultipleIntMessages(totalMessages/2, totalMessages, channel, pubnub);
-
- long endtime = common.Timestamp(pubnub);
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestUnencryptedDetailedHistoryParams1");
-
- common.DeliveryStatus = false;
- common.Response = null;
- Console.WriteLine("DetailedHistory with start & end");
-
- pubnub.DetailedHistory(channel, starttime, midtime, totalMessages / 2, true, common.DisplayReturnMessage);
-
- while (!common.DeliveryStatus) ;
-
- Console.WriteLine("DetailedHistory with start & reverse = true");
-
- ParseResponse(common.Response, 0, totalMessages/2, "");
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestUnencryptedDetailedHistoryParams2");
-
- common.DeliveryStatus = false;
- common.Response = null;
- pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, true, common.DisplayReturnMessage);
-
- while (!common.DeliveryStatus) ;
-
- Console.WriteLine("DetailedHistory with start & reverse = false");
-
- ParseResponse(common.Response, totalMessages/2, totalMessages, "");
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestUnencryptedDetailedHistoryParams3");
-
- common.DeliveryStatus = false;
- common.Response = null;
- pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, false, common.DisplayReturnMessage);
-
- while (!common.DeliveryStatus) ;
-
- Console.WriteLine("\n******* DetailedHistory Messages Received ******* ");
-
- ParseResponse(common.Response, 0, totalMessages/2, "");
- }
-
- [Test]
- public void TestEncryptedDetailedHistoryParams()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "enigma",
- false);
-
- string channel = "hello_world";
-
- int totalMessages = 10;
-
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- long starttime = common.Timestamp(pubnub);
-
- SendMultipleIntMessages(0, totalMessages/2, channel, pubnub);
-
- long midtime = common.Timestamp(pubnub);
-
- SendMultipleIntMessages(totalMessages/2, totalMessages, channel, pubnub);
-
- long endtime = common.Timestamp(pubnub);
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestEncryptedDetailedHistoryParams1");
-
- common.DeliveryStatus = false;
- common.Response = null;
- Console.WriteLine("DetailedHistory with start & end");
-
- pubnub.DetailedHistory(channel, starttime, midtime, totalMessages / 2, true, common.DisplayReturnMessage);
-
- while (!common.DeliveryStatus) ;
-
- Console.WriteLine("DetailedHistory with start & reverse = true");
-
- ParseResponse(common.Response, 0, totalMessages/2, "");
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestEncryptedDetailedHistoryParams2");
-
- common.DeliveryStatus = false;
- common.Response = null;
- pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, true, common.DisplayReturnMessage);
-
- while (!common.DeliveryStatus) ;
-
- Console.WriteLine("DetailedHistory with start & reverse = false");
-
- ParseResponse(common.Response, totalMessages/2, totalMessages, "");
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestEncryptedDetailedHistoryParams3");
-
- common.DeliveryStatus = false;
- common.Response = null;
- pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, false, common.DisplayReturnMessage);
-
- while (!common.DeliveryStatus) ;
-
- Console.WriteLine("\n******* DetailedHistory Messages Received ******* ");
-
- ParseResponse(common.Response, 0, totalMessages/2, "");
-
- }
-
- [Test]
- public void TestUnencryptedDetailedHistory()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "",
- false);
-
- string channel = "hello_world";
- int totalMessages = 10;
-
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- long starttime = common.Timestamp(pubnub);
-
- SendMultipleIntMessages(0, totalMessages/2, channel, pubnub);
-
- long midtime = common.Timestamp(pubnub);
-
- SendMultipleIntMessages(totalMessages/2, totalMessages, channel, pubnub);
-
- long endtime = common.Timestamp(pubnub);
- while (!common.DeliveryStatus) ;
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestUnencryptedDetailedHistory");
-
- common.DeliveryStatus = false;
- common.Response = null;
-
- pubnub.DetailedHistory(channel, totalMessages, common.DisplayReturnMessage);
- while (!common.DeliveryStatus) ;
-
- Console.WriteLine("\n******* DetailedHistory Messages Received ******* ");
-
- ParseResponse(common.Response, 0, totalMessages, "");
- }
-
- [Test]
- public void TestEncryptedDetailedHistory()
- {
- Pubnub pubnub = new Pubnub(
- "demo",
- "demo",
- "",
- "enigma",
- false);
- string channel = "hello_world";
-
- int totalMessages = 10;
-
- Common common = new Common();
- common.DeliveryStatus = false;
- common.Response = null;
-
- long starttime = common.Timestamp(pubnub);
-
- SendMultipleIntMessages(0, totalMessages, channel, pubnub);
-
- long midtime = common.Timestamp(pubnub);
-
- SendMultipleIntMessages(totalMessages, totalMessages/2, channel, pubnub);
-
- long endtime = common.Timestamp(pubnub);
- while (!common.DeliveryStatus) ;
-
- pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestEncryptedDetailedHistory");
-
- common.Response = null;
- common.DeliveryStatus = false;
-
- pubnub.DetailedHistory(channel, totalMessages, common.DisplayReturnMessage);
-
- while (!common.DeliveryStatus) ;
- Console.WriteLine("\n*********** DetailedHistory Messages Received*********** ");
-
- ParseResponse(common.Response, 0, totalMessages, "");
- }
-
- [Test]
- public void DetailedHistoryExample()
- {
- Pubnub pubnub = new Pubnub(