コード例 #1
0
        public void InvalidId_ThrowsHttpRequestException()
        {
            var response = SteamApiClient.GetFriendslistAsync(0)
                           .Result;

            Assert.False(response.Successful);
            Assert.NotNull(response.ThrownException);
            Assert.Null(response.Contents);
            Assert.True(response.ThrownException is HttpRequestException);
        }
コード例 #2
0
        public void ValidId_ReturnsUsersFriendslist(ulong id64)
        {
            var response = SteamApiClient.GetFriendslistAsync(id64)
                           .Result;

            SleepAfterSendingRequest();

            Assert.NotNull(response);
            Assert.NotEmpty(response.Contents);
            Assert.All(response.Contents, r => Assert.True(r.Id64 != 0));
        }
コード例 #3
0
        public void PrivateProfileId_ThrowsPrivateResponseException()
        {
            var response = SteamApiClient.GetFriendslistAsync(76561198089305067)
                           .Result;

            SleepAfterSendingRequest();

            Assert.False(response.Successful);
            Assert.NotNull(response.ThrownException);
            Assert.Null(response.Contents);
            Assert.True(response.ThrownException is ApiPrivateContentException);
        }