public void PlayerStatisticsApi() { int testStatExpected = 0, testStatActual = int.MinValue; var getStatTask1 = Client.GetPlayerStatisticsAsync(); try { getStatTask1.Wait(); } catch (Exception ex) { UUnitAssert.True(false, ex.Message); } UUnitAssert.NotNull(getStatTask1.Result, "PlayerStatistics should have been retrieved from Api call"); foreach (var eachStat in getStatTask1.Result) { if (eachStat.StatisticName == TEST_STAT_NAME) { testStatExpected = eachStat.Value; } } testStatExpected = (testStatExpected + 1) % 100; // This test is about the expected value changing (incrementing through from TEST_STAT_BASE to TEST_STAT_BASE * 2 - 1) var updateTask = Client.UpdatePlayerStatisticsAsync(new List <StatisticUpdate> { new StatisticUpdate { StatisticName = TEST_STAT_NAME, Value = testStatExpected } }); try { updateTask.Wait(); // The update doesn't return anything, so can't test anything other than failure } catch (Exception ex) { UUnitAssert.Fail(ex.Message); } var getStatTask2 = Client.GetPlayerStatisticsAsync(); try { getStatTask2.Wait(); } catch (Exception ex) { UUnitAssert.Fail(ex.Message); } UUnitAssert.NotNull(getStatTask2.Result, "PlayerStatistics should have been retrieved from Api call"); foreach (var eachStat in getStatTask2.Result) { if (eachStat.StatisticName == TEST_STAT_NAME) { testStatActual = eachStat.Value; } } UUnitAssert.IntEquals(testStatExpected, testStatActual); }