Exemplo n.º 1
0
        private QueryParameter ConstructApiQuery(string key, string type, string data)
        {
            QueryParameter query = new QueryParameter();

            query.AddValue(API_KEY_KEY, key);
            query.AddValue(TYPE_KEY, type);
            query.AddValue(DATA_KEY, data);
            return(query);
        }
        public async Task Send_GetQueryRequest_ReturnsReponse()
        {
            QueryParameter query = new QueryParameter();

            query.AddValue(TEST_KEY, TEST_VALUE);
            MockResponse(HttpVerb.GET, HttpStatusCode.OK, TEST_RESPONSE);
            HttpResponse response = await _testRequest.Send(HttpVerb.GET, query);

            Assert.IsTrue(response.Success);
            Assert.AreEqual(HttpStatusCode.OK, response.Status);
        }
Exemplo n.º 3
0
 public void Format_WithOneValue_ReturnsQueryString()
 {
     _parameter.AddValue(TEST_KEY, TEST_VALUE);
     Assert.AreEqual($"?{TEST_KEY}={TEST_VALUE}", _parameter.Format());
 }