Permalink
Browse files

refactored naming conventions in test projects

  • Loading branch information...
1 parent ae1b544 commit e35ec4949fc1f4b540f490136b0d29773477dd15 @budgetpreneur budgetpreneur committed Jan 8, 2013
Showing with 1,170 additions and 1,192 deletions.
  1. +92 −92 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/EncryptionTests.cs
  2. +19 −19 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/PubnubUnitTest.cs
  3. +29 −29 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenAClientIsPresented.cs
  4. +112 −113 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenAMessageIsPublished.cs
  5. +42 −44 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenDetailedHistoryIsRequested.cs
  6. +11 −11 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenGetRequestServerTime.cs
  7. +18 −19 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.Test/UnitTest/WhenSubscribedToAChannel.cs
  8. BIN csharp-windows-phone/3.3.0.1/PubnubWindowsPhone.suo
  9. +338 −339 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/Pubnub.cs
  10. +2 −2 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PubnubOperation.xaml
  11. +27 −28 csharp-windows-phone/3.3.0.1/PubnubWindowsPhone/PubnubOperation.xaml.cs
  12. +92 −91 csharp/3.3.0.1/PubNub-Messaging.Tests/EncryptionTests.cs
  13. +19 −19 csharp/3.3.0.1/PubNub-Messaging.Tests/PubnubUnitTest.cs
  14. +29 −29 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenAClientIsPresented.cs
  15. +112 −113 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenAMessageIsPublished.cs
  16. +42 −42 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenDetailedHistoryIsRequested.cs
  17. +17 −17 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenGetRequestServerTime.cs
  18. +26 −28 csharp/3.3.0.1/PubNub-Messaging.Tests/WhenSubscribedToAChannel.cs
  19. +1 −1 csharp/3.3.0.1/PubNub-Messaging/PubNub-Messaging.csproj
  20. +140 −141 csharp/3.3.0.1/PubNub-Messaging/Pubnub.cs
  21. +2 −15 csharp/3.3.0.1/PubNub-Messaging/app.config
  22. BIN csharp/3.3.0.1/PubNub-Messaging/bin/Debug/Newtonsoft.Json.dll
  23. BIN csharp/3.3.0.1/PubNub.suo

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -259,7 +259,7 @@ public bool EnableStubTest
public string GetStubResponse(Uri request)
{
- Dictionary<string, string> respDic = null;
+ Dictionary<string, string> responseDictionary = null;
string stubResponse = "!! Stub Response Not Assigned !!";
switch (_testClassName)
@@ -268,10 +268,10 @@ public string GetStubResponse(Uri request)
switch (_testCaseName)
{
case "ThenPresenceShouldReturnReceivedMessage":
- respDic = LoadWhenAClientIsPresentedThenPresenceShouldReturnReceivedMessage();
+ responseDictionary = LoadWhenAClientIsPresentedThenPresenceShouldReturnReceivedMessage();
break;
case "IfHereNowIsCalledThenItShouldReturnInfo":
- respDic = LoadWhenAClientIsPresentedIfHereNowIsCalledThenItShouldReturnInfo();
+ responseDictionary = LoadWhenAClientIsPresentedIfHereNowIsCalledThenItShouldReturnInfo();
break;
default:
break;
@@ -281,25 +281,25 @@ public string GetStubResponse(Uri request)
switch (_testCaseName)
{
case "ThenUnencryptPublishShouldReturnSuccessCodeAndInfo":
- respDic = LoadWhenAMessageIsPublishedThenUnencryptPublishShouldReturnSuccessCodeAndInfo();
+ responseDictionary = LoadWhenAMessageIsPublishedThenUnencryptPublishShouldReturnSuccessCodeAndInfo();
break;
case "ThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo":
- respDic = LoadWhenAMessageIsPublishedThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo();
+ responseDictionary = LoadWhenAMessageIsPublishedThenUnencryptObjectPublishShouldReturnSuccessCodeAndInfo();
break;
case "ThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo":
- respDic = LoadWhenAMessageIsPublishedThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo();
+ responseDictionary = LoadWhenAMessageIsPublishedThenEncryptObjectPublishShouldReturnSuccessCodeAndInfo();
break;
case "ThenEncryptPublishShouldReturnSuccessCodeAndInfo":
- respDic = LoadWhenAMessageIsPublishedThenEncryptPublishShouldReturnSuccessCodeAndInfo();
+ responseDictionary = LoadWhenAMessageIsPublishedThenEncryptPublishShouldReturnSuccessCodeAndInfo();
break;
case "ThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo":
- respDic = LoadWhenAMessageIsPublishedThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo();
+ responseDictionary = LoadWhenAMessageIsPublishedThenSecretKeyWithEncryptPublishShouldReturnSuccessCodeAndInfo();
break;
case "ThenOptionalSecretKeyShouldBeProvidedInConstructor":
- respDic = LoadWhenAMessageIsPublishedThenOptionalSecretKeyShouldBeProvidedInConstructor();
+ responseDictionary = LoadWhenAMessageIsPublishedThenOptionalSecretKeyShouldBeProvidedInConstructor();
break;
case "IfSSLNotProvidedThenDefaultShouldBeFalse":
- respDic = LoadWhenAMessageIsPublishedIfSSLNotProvidedThenDefaultShouldBeFalse();
+ responseDictionary = LoadWhenAMessageIsPublishedIfSSLNotProvidedThenDefaultShouldBeFalse();
break;
default:
break;
@@ -309,13 +309,13 @@ public string GetStubResponse(Uri request)
switch (_testCaseName)
{
case "DetailHistoryCount10ReturnsRecords":
- respDic = LoadWhenDetailedHistoryIsRequestedDetailHistoryCount10ReturnsRecords();
+ responseDictionary = LoadWhenDetailedHistoryIsRequestedDetailHistoryCount10ReturnsRecords();
break;
case "DetailHistoryCount10ReverseTrueReturnsRecords":
- respDic = LoadWhenDetailedHistoryIsRequestedDetailHistoryCount10ReverseTrueReturnsRecords();
+ responseDictionary = LoadWhenDetailedHistoryIsRequestedDetailHistoryCount10ReverseTrueReturnsRecords();
break;
case "DetailedHistoryStartWithReverseTrue":
- respDic = LoadWhenDetailedHistoryIsRequestedDetailedHistoryStartWithReverseTrue();
+ responseDictionary = LoadWhenDetailedHistoryIsRequestedDetailedHistoryStartWithReverseTrue();
break;
default:
break;
@@ -325,10 +325,10 @@ public string GetStubResponse(Uri request)
switch (_testCaseName)
{
case "ThenItShouldReturnTimeStamp":
- respDic = LoadWhenGetRequestServerTimeThenItShouldReturnTimeStamp();
+ responseDictionary = LoadWhenGetRequestServerTimeThenItShouldReturnTimeStamp();
break;
case "ThenWithProxyItShouldReturnTimeStamp":
- respDic = LoadWhenGetRequestServerTimeThenWithProxyItShouldReturnTimeStamp();
+ responseDictionary = LoadWhenGetRequestServerTimeThenWithProxyItShouldReturnTimeStamp();
break;
default:
break;
@@ -338,10 +338,10 @@ public string GetStubResponse(Uri request)
switch (_testCaseName)
{
case "ThenSubscribeShouldReturnReceivedMessage":
- respDic = LoadWhenSubscribedToAChannelThenSubscribeShouldReturnReceivedMessage();
+ responseDictionary = LoadWhenSubscribedToAChannelThenSubscribeShouldReturnReceivedMessage();
break;
case "ThenSubscribeShouldReturnConnectStatus":
- respDic = LoadWhenSubscribedToAChannelThenSubscribeShouldReturnConnectStatus();
+ responseDictionary = LoadWhenSubscribedToAChannelThenSubscribeShouldReturnConnectStatus();
break;
default:
break;
@@ -351,9 +351,9 @@ public string GetStubResponse(Uri request)
break;
}
- if (respDic != null && respDic.ContainsKey(request.AbsolutePath))
+ if (responseDictionary != null && responseDictionary.ContainsKey(request.AbsolutePath))
{
- stubResponse = respDic[request.AbsolutePath];
+ stubResponse = responseDictionary[request.AbsolutePath];
}
else
{
@@ -22,20 +22,20 @@ namespace PubnubWindowsPhone.Test.UnitTest
[TestClass]
public class WhenAClientIsPresented : WorkItemTest
{
- ManualResetEvent manualEvent1 = new ManualResetEvent(false);
- ManualResetEvent manualEvent2 = new ManualResetEvent(false);
- ManualResetEvent manualEvent3 = new ManualResetEvent(false);
+ ManualResetEvent subscribeManualEvent = new ManualResetEvent(false);
+ ManualResetEvent presenceManualEvent = new ManualResetEvent(false);
+ ManualResetEvent unsubscribeManualEvent = new ManualResetEvent(false);
- ManualResetEvent manualEvent4 = new ManualResetEvent(false);
- ManualResetEvent preUnsubEvent = new ManualResetEvent(false);
+ ManualResetEvent hereNowManualEvent = new ManualResetEvent(false);
+ ManualResetEvent presenceUnsubscribeEvent = new ManualResetEvent(false);
- static bool receivedFlag1 = false;
- static bool receivedFlag2 = false;
+ static bool receivedPresenceMessage = false;
+ static bool receivedHereNowMessage = false;
[TestMethod,Asynchronous]
public void ThenPresenceShouldReturnReceivedMessage()
{
- receivedFlag1 = false;
+ receivedPresenceMessage = false;
ThreadPool.QueueUserWorkItem((s) =>
{
Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
@@ -50,18 +50,18 @@ public void ThenPresenceShouldReturnReceivedMessage()
//since presence expects from stimulus from sub/unsub...
pubnub.Subscribe<string>(channel, DummyMethodForSubscribe);
- manualEvent1.WaitOne(2000);
+ subscribeManualEvent.WaitOne(2000);
pubnub.Unsubscribe<string>(channel, DummyMethodForUnSubscribe);
- manualEvent3.WaitOne(2000);
+ unsubscribeManualEvent.WaitOne(2000);
pubnub.PresenceUnsubscribe<string>(channel, DummyMethodForPreUnSub);
- preUnsubEvent.WaitOne(2000);
+ presenceUnsubscribeEvent.WaitOne(2000);
- manualEvent2.WaitOne(310 * 1000);
+ presenceManualEvent.WaitOne(310 * 1000);
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
- Assert.IsTrue(receivedFlag1, "Presence message not received");
+ Assert.IsTrue(receivedPresenceMessage, "Presence message not received");
TestComplete();
});
});
@@ -74,27 +74,27 @@ void ThenPresenceShouldReturnMessage(string receivedMessage)
{
if (!string.IsNullOrWhiteSpace(receivedMessage))
{
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(receivedMessage);
- JContainer dic = receivedObj[0] as JContainer;
- var uuid = dic["uuid"].ToString();
+ object[] serializedMessage = JsonConvert.DeserializeObject<object[]>(receivedMessage);
+ JContainer dictionary = serializedMessage[0] as JContainer;
+ var uuid = dictionary["uuid"].ToString();
if (uuid != null)
{
- receivedFlag1 = true;
+ receivedPresenceMessage = true;
}
}
}
catch { }
finally
{
- manualEvent2.Set();
+ presenceManualEvent.Set();
}
}
[TestMethod,Asynchronous]
public void IfHereNowIsCalledThenItShouldReturnInfo()
{
- receivedFlag2 = false;
+ receivedHereNowMessage = false;
ThreadPool.QueueUserWorkItem((s) =>
{
Pubnub pubnub = new Pubnub("demo", "demo", "", "", false);
@@ -106,10 +106,10 @@ public void IfHereNowIsCalledThenItShouldReturnInfo()
pubnub.PubnubUnitTest = unitTest;
pubnub.HereNow<string>(channel, ThenHereNowShouldReturnMessage);
- manualEvent4.WaitOne();
+ hereNowManualEvent.WaitOne();
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
- Assert.IsTrue(receivedFlag2, "here_now message not received");
+ Assert.IsTrue(receivedHereNowMessage, "here_now message not received");
TestComplete();
});
});
@@ -124,40 +124,40 @@ void ThenHereNowShouldReturnMessage(string receivedMessage)
{
if (!string.IsNullOrWhiteSpace(receivedMessage))
{
- object[] receivedObj = JsonConvert.DeserializeObject<object[]>(receivedMessage);
- var dic = ((JContainer)receivedObj[0])["uuids"];
- if (dic != null)
+ object[] serializedMessage = JsonConvert.DeserializeObject<object[]>(receivedMessage);
+ var dictionary = ((JContainer)serializedMessage[0])["uuids"];
+ if (dictionary != null)
{
- receivedFlag2 = true;
+ receivedHereNowMessage = true;
}
}
});
}
catch { }
finally
{
- manualEvent4.Set();
+ hereNowManualEvent.Set();
}
}
[Asynchronous]
void DummyMethodForSubscribe(string receivedMessage)
{
- manualEvent1.Set();
+ subscribeManualEvent.Set();
//Dummary callback method for subscribe and unsubscribe to test presence
}
[Asynchronous]
void DummyMethodForUnSubscribe(string receivedMessage)
{
- manualEvent3.Set();
+ unsubscribeManualEvent.Set();
//Dummary callback method for unsubscribe to test presence
}
[Asynchronous]
void DummyMethodForPreUnSub(string receivedMessage)
{
- preUnsubEvent.Set();
+ presenceUnsubscribeEvent.Set();
}
}
}
Oops, something went wrong.

0 comments on commit e35ec49

Please sign in to comment.