Example #1
0
        public void BuildUriHasCorrectUserLocaleParameter()
        {
            var builder = new AppleDeveloperRequestUriBuilder(new Uri("http://www.foo.ext"));
            var uri     = builder.ToUri();

            var query = HttpUtility.ParseQueryString(uri.Query);

            Assert.Equal("en_US", query["userLocale"]);
        }
Example #2
0
        public void BuildUriHasCorrectAcceptParameter()
        {
            var builder = new AppleDeveloperRequestUriBuilder(new Uri("http://www.foo.ext"));
            var uri     = builder.ToUri();

            var query = HttpUtility.ParseQueryString(uri.Query);

            Assert.Equal("application/json", query["accept"]);
        }
Example #3
0
        public void BuildUriHasCorrectContentTypeParameter()
        {
            var builder = new AppleDeveloperRequestUriBuilder(new Uri("http://www.foo.ext"));
            var uri     = builder.ToUri();

            var query = HttpUtility.ParseQueryString(uri.Query);

            Assert.Equal("text/x-url-arguments", query["content-type"]);
        }
Example #4
0
        public void BuildUriHasRequestIdParameter()
        {
            var builder = new AppleDeveloperRequestUriBuilder(new Uri("http://www.foo.ext"));
            var uri     = builder.ToUri();

            var query = HttpUtility.ParseQueryString(uri.Query);

            Assert.NotNull(query["requestId"]);
            Assert.NotEqual(string.Empty, query["requestId"]);
        }
Example #5
0
        public void RequestIdChangesWithEveryCallOfToUri()
        {
            var builder = new AppleDeveloperRequestUriBuilder(new Uri("http://www.foo.ext"));
            var uri1    = builder.ToUri();
            var uri2    = builder.ToUri();

            var query1 = HttpUtility.ParseQueryString(uri1.Query);
            var query2 = HttpUtility.ParseQueryString(uri2.Query);

            Assert.NotEqual(query1["requestId"], query2["requestId"]);
        }
Example #6
0
        public void AddQueryValuesAddsValuesToTheQuery()
        {
            var builder = new AppleDeveloperRequestUriBuilder(new Uri("http://www.foo.ext"));

            builder.AddQueryValues(new Dictionary <string, string> {
                { "x", "y" },
                { "foo", "bar" }
            });
            var uri = builder.ToUri();

            var query = HttpUtility.ParseQueryString(uri.Query);

            Assert.Equal("y", query["x"]);
            Assert.Equal("bar", query["foo"]);
        }