Skip to content

Commit

Permalink
add temp debug method for PubnubCommon values
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-grzesiowski committed Sep 24, 2024
1 parent 863b17a commit 8976cf5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/UnitTests/PubnubApi.Tests/PubnubCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ public static class PubnubCommon
static PubnubCommon()
{
}

public static string TEMP_DumpInfo()
{
return $"EnvPAMServerSideRun: {EnvPAMServerSideRun}, EnvPublishKey: {EnvPublishKey}, EnvSubscribeKey: {EnvSubscribeKey}, EnvSecretKey: {EnvSecretKey}";
}
}
}
7 changes: 3 additions & 4 deletions src/UnitTests/PubnubApi.Tests/WhenObjectChannelMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public static async Task Init()

if (!PubnubCommon.PAMServerSideGrant)
{
Assert.Fail("-----TEST FAIL ASSERT-----");
return;
}

Expand Down Expand Up @@ -244,7 +243,7 @@ public static void ThenChannelMetadataCRUDShouldReturnSuccessCodeAndInfo()

if (!receivedMessage)
{
Assert.IsTrue(receivedMessage, "SetChannelMetadata/DeleteChannelMetadataId Failed");
Assert.IsTrue(receivedMessage, $"SetChannelMetadata/DeleteChannelMetadataId Failed, DUMP DATA:\n{PubnubCommon.TEMP_DumpInfo()}");
}

pubnub.Destroy();
Expand Down Expand Up @@ -406,7 +405,7 @@ public static async Task ThenWithAsyncChannelMetadataCRUDShouldReturnSuccessCode

if (!receivedMessage)
{
Assert.IsTrue(receivedMessage, "SeChannelMetadata/DeleteChannelMetadata Failed");
Assert.IsTrue(receivedMessage, $"SeChannelMetadata/DeleteChannelMetadata Failed, DUMP DATA:\n{PubnubCommon.TEMP_DumpInfo()}");
}

pubnub.Destroy();
Expand Down Expand Up @@ -545,7 +544,7 @@ public static void ThenChannelMetadataSetDeleteShouldReturnEventInfo()
pubnub.Unsubscribe<string>().Channels(new string[] { channelMetadataId }).Execute();
pubnub.RemoveListener(eventListener);

Assert.IsTrue(receivedDeleteEvent && receivedUpdateEvent, "Channel Metadata events Failed");
Assert.IsTrue(receivedDeleteEvent && receivedUpdateEvent, $"Channel Metadata events Failed, DUMP DATA:\n{PubnubCommon.TEMP_DumpInfo()}");

pubnub.Destroy();
pubnub.PubnubUnitTest = null;
Expand Down

0 comments on commit 8976cf5

Please sign in to comment.