public async Task SteamCommunityDataClientIsNull_ThrowsArgumentNullException()
            {
                // Arrange
                ISteamCommunityDataClient steamCommunityDataClient = null;
                var appId = 247080U;

                // Act -> Assert
                await Assert.ThrowsAsync <ArgumentNullException>(() =>
                {
                    return(steamCommunityDataClient.GetLeaderboardsAsync(appId));
                });
            }
            public void ClientIsNull_ThrowsArgumentNullException()
            {
                // Arrange
                ISteamCommunityDataClient client = null;
                var appId         = 247080U;
                var leaderboardId = 739999;

                // Act -> Assert
                Assert.Throws <ArgumentNullException>(() =>
                {
                    client.GetLeaderboardEntriesAsync(appId, leaderboardId);
                });
            }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="steamCommunityDataClient"></param>
        /// <param name="appId"></param>
        /// <param name="progress"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static Task <LeaderboardsEnvelope> GetLeaderboardsAsync(
            this ISteamCommunityDataClient steamCommunityDataClient,
            uint appId,
            IProgress <long> progress           = default,
            CancellationToken cancellationToken = default)
        {
            if (steamCommunityDataClient == null)
            {
                throw new ArgumentNullException(nameof(steamCommunityDataClient));
            }

            return(steamCommunityDataClient.GetLeaderboardsAsync(appId.ToString(), progress, cancellationToken));
        }