public void WillAddQueryStringParameters()
        {
            var options = new RequestOptions();

            options.AddHeader("Accept-Language", "en-US");
            var date          = new DateTime(2020, 01, 01);
            var paramsMatcher = MockClient.QueryParameterMatcher(new Dictionary <string, object> {
                { "param_1", "param1" },
                { "param_2", Recurly.Utils.ISO8601(date) },
            });

            var        client   = MockClient.Build(paramsMatcher, SuccessResponse(System.Net.HttpStatusCode.OK));
            MyResource resource = client.GetResource("benjamin", "param1", date, options);

            Assert.Equal("benjamin", resource.MyString);
        }
Beispiel #2
0
        public void PagerFirstTest()
        {
            var paramsMatcher = MockClient.QueryParameterMatcher(new Dictionary <string, object> {
                { "limit", "1" },
                { "a", "1" },
            });
            var client = MockClient.Build(paramsMatcher, PagerFirstResponse());

            var queryParams = new Dictionary <string, object> {
                { "limit", "200" },
                { "a", "1" },
            };
            var pager = Pager <MyResource> .Build("/resources", queryParams, null, client);

            var resource = pager.First();

            Assert.Equal("First Resource", resource.MyString);
        }