public void CreateMessageInboxRequestQuery()
        {
            MessageInboxRequestQuery    query = new MessageInboxRequestQuery(10, 90);
            Dictionary <string, string> nv    = query.GetQuery();

            Assert.IsNotEmpty(nv);
            Assert.AreEqual(2, nv.Count);
            Assert.AreEqual("10", nv["skipItems"]);
            Assert.AreEqual("90", nv["maxItems"]);
        }
Пример #2
0
        public void CreateMessageInboxRequestQuery()
        {
            MessageInboxRequestQuery query = new MessageInboxRequestQuery(10, 90);
            NameValueCollection      nv    = query.GetQuery();

            Assert.IsNotEmpty(nv);
            Assert.AreEqual(2, nv.Count);
            Assert.AreEqual("10", nv["skipItems"]);
            Assert.AreEqual("90", nv["maxItems"]);
        }
        public async Task <ConversationsResponse> GetConversationsAsync(int skipItems = 0, int maxItems = 100)
        {
            MessageInboxRequestQuery query = new MessageInboxRequestQuery(
                skipItems, maxItems);
            var request = new HttpRequestMessage(HttpMethod.Get,
                                                 $"users/xuid({Config.XboxUserId})/inbox/conversations");

            request.Headers.Add(Headers);
            request.AddQueryParameter(query.GetQuery());

            var response = await HttpClient.SendAsync(request);

            return(await response.Content.ReadAsJsonAsync <ConversationsResponse>());
        }
Пример #4
0
        public ConversationsResponse GetConversations(int skipItems = 0, int maxItems = 100)
        {
            MessageInboxRequestQuery query = new MessageInboxRequestQuery(
                skipItems, maxItems);
            RestRequestEx request = new RestRequestEx(
                $"users/xuid({Config.XboxUserId})/inbox/conversations", Method.GET);

            request.AddHeaders(Headers);
            request.AddQueryParameters(query.GetQuery());

            IRestResponse <ConversationsResponse> response = HttpClient.Execute <ConversationsResponse>(request);

            return(response.Data);
        }