Skip to content

Commit

Permalink
Merge pull request #20 from PlayFab/master
Browse files Browse the repository at this point in the history
Pushing new version
  • Loading branch information
Paul Gilmore committed Sep 28, 2015
2 parents d5d9555 + 60422a6 commit 920b327
Show file tree
Hide file tree
Showing 17 changed files with 910 additions and 1,008 deletions.
2 changes: 1 addition & 1 deletion PlayFabClientSDK/source/PlayFabClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ public static async Task<PlayFabResult<GetPlayFabIDsFromSteamIDsResult>> GetPlay
}

/// <summary>
/// Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved any any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user.
/// Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user.
/// </summary>
public static async Task<PlayFabResult<GetUserCombinedInfoResult>> GetUserCombinedInfoAsync(GetUserCombinedInfoRequest request)
{
Expand Down
2 changes: 1 addition & 1 deletion PlayFabClientSDK/source/PlayFabVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace PlayFab.Internal
{
public class PlayFabVersion
{
public static string ApiRevision = "1.5.20150901";
public static string ApiRevision = "1.6.20150928";
public static string SdkRevision = "1.0.2";

public static string getVersionString()
Expand Down
261 changes: 109 additions & 152 deletions PlayFabClientSDK/source/Uunit/UUnitAssert.cs
Original file line number Diff line number Diff line change
@@ -1,152 +1,109 @@
/*
* UUnit system from UnityCommunity
* Heavily modified
* 0.4 release by pboechat
* http://wiki.unity3d.com/index.php?title=UUnit
* http://creativecommons.org/licenses/by-sa/3.0/
*/

using System;

namespace PlayFab.UUnit
{
public class UUnitAssert
{
public static double DEFAULT_DOUBLE_PRECISION = 0.000001;

private UUnitAssert()
{
}

public static void Skip()
{
throw new UUnitSkipException();
}

public static void Fail(string message = null)
{
if (string.IsNullOrEmpty(message))
message = "fail";
throw new UUnitAssertException(message);
}

public static void True(bool boolean, string message = null)
{
if (boolean)
{
return;
}
if (string.IsNullOrEmpty(message))
throw new UUnitAssertException(true, false);
else
throw new UUnitAssertException(true, false, message);
}

public static void False(bool boolean, string message = null)
{
if (!boolean)
{
return;
}
if (string.IsNullOrEmpty(message))
throw new UUnitAssertException(true, false);
else
throw new UUnitAssertException(true, false, message);
}

public static void NotNull(object something, string message = null)
{
if (something != null)
return; // Success

if (string.IsNullOrEmpty(message))
message = "Null object";
throw new UUnitAssertException(message);
}

public static void Null(object something, string message = null)
{
if (something == null)
return;

if (string.IsNullOrEmpty(message))
message = "Not null object";
throw new UUnitAssertException(message);
}

public static void Equals(string wanted, string got, string message)
{
if (wanted == got)
{
return;
}
throw new UUnitAssertException(wanted, got, message);
}

public static void Equals(string wanted, string got)
{
if (wanted == got)
return;
throw new UUnitAssertException(wanted, got);
}

public static void Equals(int wanted, int got, string message)
{
if (wanted == got)
{
return;
}
throw new UUnitAssertException(wanted, got, message);
}

public static void Equals(int wanted, int got)
{
if (wanted == got)
{
return;
}
throw new UUnitAssertException(wanted, got);
}

public static void Equals(double wanted, double got, double precision)
{
if (Math.Abs(wanted - got) < precision)
{
return;
}
throw new UUnitAssertException(wanted, got);
}

public static void Equals(double wanted, double got)
{
Equals(wanted, got, DEFAULT_DOUBLE_PRECISION);
}

public static void Equals(char wanted, char got)
{
if (wanted == got)
{
return;
}
throw new UUnitAssertException(wanted, got);
}

public static void Equals(object wanted, object got, string message)
{
if (wanted == got)
{
return;
}
throw new UUnitAssertException(wanted, got, message);
}

public new static void Equals(object wanted, object got)
{
if (wanted == got)
{
return;
}
throw new UUnitAssertException(wanted, got);
}
}
}
/*
* UUnit system from UnityCommunity
* Heavily modified
* 0.4 release by pboechat
* http://wiki.unity3d.com/index.php?title=UUnit
* http://creativecommons.org/licenses/by-sa/3.0/
*/

using System;

namespace PlayFab.UUnit
{
public static class UUnitAssert
{
public const double DEFAULT_DOUBLE_PRECISION = 0.000001;

public static void Skip()
{
throw new UUnitSkipException();
}

public static void Fail(string message = null)
{
if (string.IsNullOrEmpty(message))
message = "fail";
throw new UUnitAssertException(message);
}

public static void True(bool boolean, string message = null)
{
if (boolean)
return;

if (string.IsNullOrEmpty(message))
message = "Expected: true, Actual: false";
throw new UUnitAssertException(true, false, message);
}

public static void False(bool boolean, string message = null)
{
if (!boolean)
return;

if (string.IsNullOrEmpty(message))
message = "Expected: false, Actual: true";
throw new UUnitAssertException(true, false, message);
}

public static void NotNull(object something, string message = null)
{
if (something != null)
return; // Success

if (string.IsNullOrEmpty(message))
message = "Null object";
throw new UUnitAssertException(message);
}

public static void Null(object something, string message = null)
{
if (something == null)
return;

if (string.IsNullOrEmpty(message))
message = "Not null object";
throw new UUnitAssertException(message);
}

public static void Equals(string wanted, string got, string message = null)
{
if (wanted == got)
return;

if (string.IsNullOrEmpty(message))
message = "Expected: " + wanted + ", Actual: " + got;
throw new UUnitAssertException(wanted, got, message);
}

public static void Equals(int wanted, int got, string message = null)
{
if (wanted == got)
return;

if (string.IsNullOrEmpty(message))
message = "Expected: " + wanted + ", Actual: " + got;
throw new UUnitAssertException(wanted, got, message);
}

public static void Equals(double wanted, double got, double precision = DEFAULT_DOUBLE_PRECISION, string message = null)
{
if (Math.Abs(wanted - got) < precision)
return;

if (string.IsNullOrEmpty(message))
message = "Expected: " + wanted + ", Actual: " + got;
throw new UUnitAssertException(wanted, got, message);
}

public static void Equals(object wanted, object got, string message = null)
{
if (wanted == got)
return;

if (string.IsNullOrEmpty(message))
message = "Expected: " + wanted + ", Actual: " + got;
throw new UUnitAssertException(wanted, got, message);
}
}
}
93 changes: 43 additions & 50 deletions PlayFabClientSDK/source/Uunit/UUnitAssertException.cs
Original file line number Diff line number Diff line change
@@ -1,50 +1,43 @@
/*
* UUnit system from UnityCommunity
* Heavily modified
* 0.4 release by pboechat
* http://wiki.unity3d.com/index.php?title=UUnit
* http://creativecommons.org/licenses/by-sa/3.0/
*/

using System;

namespace PlayFab.UUnit
{
/// <summary>
/// Throw this exception, via UUnitAssert utility function, in order to define when a test has been skipped.
/// The only information shown will be the "skipped" notification
/// </summary>
public class UUnitSkipException : Exception { }

/// <summary>
/// Throw this exception, via UUnitAssert utility functions, in order to define when a test has failed.
/// The traceback and message will automatically be displayed as a failure
/// </summary>
public class UUnitAssertException : Exception
{
public object expected;
public object received;
public string message;

public UUnitAssertException(string message)
: base(message)
{
this.message = message;
}

public UUnitAssertException(object expected, object received, string message)
: base("[UUnit] - Assert Failed - Expected: " + expected + " Received: " + received + "\n\t\t(" + message + ")")
{
this.expected = (expected == null) ? "null" : expected;
this.received = (received == null) ? "null" : received;
this.message = (message == null) ? "" : message;
}

public UUnitAssertException(object expected, object received)
: base("[UUnit] - Assert Failed - Expected: " + expected + " Received: " + received)
{
this.expected = (expected == null) ? "null" : expected;
this.received = (received == null) ? "null" : received;
}
}
}
/*
* UUnit system from UnityCommunity
* Heavily modified
* 0.4 release by pboechat
* http://wiki.unity3d.com/index.php?title=UUnit
* http://creativecommons.org/licenses/by-sa/3.0/
*/

using System;

namespace PlayFab.UUnit
{
/// <summary>
/// Throw this exception, via UUnitAssert utility function, in order to define when a test has been skipped.
/// The only information shown will be the "skipped" notification
/// </summary>
public class UUnitSkipException : Exception { }

/// <summary>
/// Throw this exception, via UUnitAssert utility functions, in order to define when a test has failed.
/// The traceback and message will automatically be displayed as a failure
/// </summary>
public class UUnitAssertException : Exception
{
public object expected;
public object received;
public string message;

public UUnitAssertException(string message)
: base(message)
{
this.message = message;
}

public UUnitAssertException(object expected, object received, string message)
: base("[UUnit] - Assert Failed - Expected: " + expected + " Received: " + received + "\n\t\t(" + message + ")")
{
this.expected = (expected == null) ? "null" : expected;
this.received = (received == null) ? "null" : received;
this.message = (message == null) ? "" : message;
}
}
}
Loading

0 comments on commit 920b327

Please sign in to comment.