Esempio n. 1
0
        public void GetRequestUrlReturnsIdOnly()
        {
            const string id     = "12345";
            var          result = ContentfulClient.GetRequestUrl(RequestBaseUrl, id);

            Assert.AreEqual("http://test.com/12345", result);
        }
Esempio n. 2
0
        public void GetRequestUrlReturnsOrderBy()
        {
            const string           property  = "title";
            const OrderByDirection direction = OrderByDirection.Descending;
            var result = ContentfulClient.GetRequestUrl(RequestBaseUrl, orderByProperty: property,
                                                        orderByDirection: direction);

            Assert.AreEqual("http://test.com/?order=-title", result);
        }
Esempio n. 3
0
        public void GetRequestUrlReturnsFiltersOnly()
        {
            var filters = new ISearchFilter[]
            {
                new EqualitySearchFilter("title", "hello"),
                new EqualitySearchFilter("name", "test")
            };
            var result = ContentfulClient.GetRequestUrl(RequestBaseUrl, filters: filters);

            Assert.AreEqual("http://test.com/?title=hello&name=test", result);
        }
Esempio n. 4
0
        public void GetRequestUrlReturnsLevels()
        {
            var result = ContentfulClient.GetRequestUrl(RequestBaseUrl, includeLevels: 6);

            Assert.AreEqual("http://test.com/?include=6", result);
        }
Esempio n. 5
0
        public void GetRequestUrlReturnsLimit()
        {
            var result = ContentfulClient.GetRequestUrl(RequestBaseUrl, limit: 48);

            Assert.AreEqual("http://test.com/?limit=48", result);
        }
Esempio n. 6
0
        public void GetRequestUrlReturnsSkip()
        {
            var result = ContentfulClient.GetRequestUrl(RequestBaseUrl, skip: 15);

            Assert.AreEqual("http://test.com/?skip=15", result);
        }
Esempio n. 7
0
        public void GetRequestUrlReturnsBaseUrlIfAllPropertiesAreNull()
        {
            var result = ContentfulClient.GetRequestUrl(RequestBaseUrl);

            Assert.AreEqual(RequestBaseUrl, result);
        }