public async Task Should_retrieve_users_game_collection() { CollectionResponse response = await bgg.GetCollectionAsync(new CollectionRequest( USERNAME, stats : true)); Assert.True(response.Succeeded); CollectionResponse.ItemCollection items = response.Result; Assert.NotNull(items); Assert.Equal(56, items.Count); }
/// <summary> /// Retrieves a players collection from boardgamegeek.com /// </summary> /// <param name="client">A boardgamegeek client instance.</param> /// <param name="username">The username of the player on boardgamegeek.com.</param> /// <returns></returns> public async static Task <CollectionResponse.ItemCollection> GetCollectionAsync(this IBoardGameGeekXmlApi2Client client, string username) { if (client == null) { throw new ArgumentNullException(nameof(client)); } if (username == null) { throw new ArgumentNullException(nameof(username)); } var request = new CollectionRequest(username, own: true); var response = await client.GetCollectionAsync(request); return(response.Result); }