예제 #1
0
        public void BuildingClauseWhenOrderByOrSkipIsNotDefined()
        {
            var data   = new Dictionary <string, string>();
            var result = OffsetClause.Build(new ODataOptions <Model>(data));

            result.Should().BeEmpty();
        }
예제 #2
0
        public void BuildingClauseWhenSkipIsDefined()
        {
            var data = new Dictionary <string, string> {
                ["$orderby"] = "Id desc",
                ["$skip"]    = "20"
            };

            var result = OffsetClause.Build(new ODataOptions <Model>(data));

            result.Should().Be("OFFSET 20 ROWS");
        }
예제 #3
0
        public void BuildingClauseWhenSkipAndTopAreDefined()
        {
            var data = new Dictionary <string, string> {
                ["$orderby"] = "Id desc",
                ["$skip"]    = "40",
                ["$top"]     = "20"
            };

            var result = OffsetClause.Build(new ODataOptions <Model>(data));

            result.Should().Be("OFFSET 40 ROWS FETCH NEXT 20 ROWS ONLY");
        }