Пример #1
0
        public void CreateGetRsaKeyDataTest()
        {
            List <KeyValuePair <string, string> > result =
                PostDataFactory.CreateGetRsaKeyData("usernameOfTheCoolUser");
            var usernameKeyValuePair =
                result.FirstOrDefault(e => e.Key == "username");

            Assert.Equal("username", usernameKeyValuePair.Key);
            Assert.Equal("usernameOfTheCoolUser", usernameKeyValuePair.Value);
        }
Пример #2
0
        private GetRsaKeyResponse GetRsaKey(string username)
        {
            var postContent = PostDataFactory.CreateGetRsaKeyData(username);
            GetRsaKeyResponse getRsaKeyResponse = null;

            var response = _requestFactory.Create(HttpMethod.POST,
                                                  Uris.SteamCommunitySecureBase,
                                                  SteamCommunityEndpoints.GetRsaKey, Accept.All,
                                                  HttpHeaderValues.AcceptLanguageOne, false, true, true, true,
                                                  false, postContent);
            string responseContent = response.Content.ReadAsStringAsync().Result;

            getRsaKeyResponse =
                JsonConvert.DeserializeObject <GetRsaKeyResponse>(responseContent);
            return(getRsaKeyResponse);
        }