public void CalledWithCustomFields_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery<Organization>();
            query.WithCustomFilter("name", "cheese factory");

            // When 
            var queryString = query.BuildQuery();

            // Then
            Assert.That(queryString, Is.EqualTo("query=type:organization+name:cheese factory&sort_by=created_at&sort_order=desc&page=1&per_page=15"));
        }
        public void CalledWithOrderSet_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery<Ticket>();
            query.WithCustomFilter("name", "cheese factory").WithPaging(3, 15).WithOrdering(OrderBy.priority, Order.Asc);

            // When 
            var queryString = query.BuildQuery();

            // Then
            Assert.That(queryString, Is.EqualTo("query=type:ticket+name:cheese factory&sort_by=priority&sort_order=asc&page=3&per_page=15"));
        }
        public void CalledWithDifferentType_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery<Ticket>();
            query.WithCustomFilter("name", "cheese factory").WithPaging(3, 15);

            // When 
            var queryString = query.BuildQuery();

            // Then
            Assert.That(queryString, Is.EqualTo("query=type:ticket+name:cheese factory&sort_by=created_at&sort_order=desc&page=3&per_page=15"));
        }
        public void CalledWithCustomFieldsGreaterThan_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery<Organization>();
            query.WithCustomFilter("updated_at", "10/15/14", FilterOperator.LessThan);

            // When 
            var queryString = query.BuildQuery();

            // Then
            Assert.That(queryString, Is.EqualTo("query=type:organization+updated_at<10%2f15%2f14&sort_by=created_at&sort_order=desc&page=1&per_page=15"));
        }
Esempio n. 5
0
        public void CalledWithCustomFieldsEquals_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery <Organization>();

            query.WithCustomFilter("name", "cheese factory", FilterOperator.Equals);

            // When
            var queryString = query.BuildQuery();

            // Then
            Assert.Equal(queryString, "query=type:organization+name:cheese+factory&sort_by=created_at&sort_order=desc&page=1&per_page=15");
        }
Esempio n. 6
0
        public void CalledWithOrderSet_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery <Ticket>();

            query.WithCustomFilter("name", "cheese factory", FilterOperator.Equals).WithPaging(3, 15).WithOrdering(OrderBy.priority, Order.Asc);

            // When
            var queryString = query.BuildQuery();

            // Then
            Assert.Equal(queryString, "query=type:ticket+name:cheese+factory&sort_by=priority&sort_order=asc&page=3&per_page=15");
        }
Esempio n. 7
0
        public void CalledWithDifferentType_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery <Ticket>();

            query.WithCustomFilter("name", "cheese factory", FilterOperator.Equals).WithPaging(3, 15);

            // When
            var queryString = query.BuildQuery();

            // Then
            Assert.Equal(queryString, "query=type:ticket+name:cheese+factory&sort_by=created_at&sort_order=desc&page=3&per_page=15");
        }
Esempio n. 8
0
        public void CalledWithCustomFieldsGreaterThan_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery <Organization>();

            query.WithCustomFilter("updated_at", "10/15/14", FilterOperator.LessThan);

            // When
            var queryString = query.BuildQuery();

            // Then
            Assert.That(queryString, Is.EqualTo("query=type:organization+updated_at<10%2f15%2f14&sort_by=created_at&sort_order=desc&page=1&per_page=15"));
        }
        public void CalledWithCustomFieldsAndPage_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery <Organization>();

            query.WithCustomFilter("name", "cheese factory").WithPaging(3, 15);

            // When
            var queryString = query.BuildQuery();

            // Then
            Assert.That(queryString, Is.EqualTo("query=type:organization+name:cheese+factory&sort_by=created_at&sort_order=desc&page=3&per_page=15"));
        }
Esempio n. 10
0
        public void CalledWithCustomFieldsGreaterThan_BuildsQuery()
        {
            // Given
            var query = new ZendeskQuery <Organization>();

            query.WithCustomFilter("updated_at", "10/15/14", FilterOperator.LessThan);

            // When
            var queryString = query.BuildQuery();

            // Then
            const string expected = "query=type:organization+updated_at<10%2f15%2f14&sort_by=created_at&sort_order=desc&page=1&per_page=15";

            Assert.Equal(queryString, expected, ignoreCase: true);
        }