本文整理汇总了C#中Microsoft.OData.Core.UriParser.ODataUriParser.ParseSkipToken方法的典型用法代码示例。如果您正苦于以下问题:C# ODataUriParser.ParseSkipToken方法的具体用法?C# ODataUriParser.ParseSkipToken怎么用?C# ODataUriParser.ParseSkipToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Core.UriParser.ODataUriParser
的用法示例。
在下文中一共展示了ODataUriParser.ParseSkipToken方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NoneQueryOptionShouldWork
public void NoneQueryOptionShouldWork()
{
var uriParser = new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, FullUri);
var path = uriParser.ParsePath();
path.Should().HaveCount(1);
path.LastSegment.ShouldBeEntitySetSegment(HardCodedTestModel.GetPeopleSet());
uriParser.ParseFilter().Should().BeNull();
uriParser.ParseSelectAndExpand().Should().BeNull();
uriParser.ParseOrderBy().Should().BeNull();
uriParser.ParseTop().Should().Be(null);
uriParser.ParseSkip().Should().Be(null);
uriParser.ParseCount().Should().Be(null);
uriParser.ParseSearch().Should().BeNull();
uriParser.ParseSkipToken().Should().BeNull();
uriParser.ParseDeltaToken().Should().BeNull();
}
示例2: EmptyValueQueryOptionShouldWork
public void EmptyValueQueryOptionShouldWork()
{
var uriParser = new ODataUriParser(HardCodedTestModel.TestModel, ServiceRoot, new Uri(FullUri, "?$filter=&$select=&$expand=&$orderby=&$top=&$skip=&$count=&$search=&$unknow=&$unknowvalue&$skiptoken=&$deltatoken="));
var path = uriParser.ParsePath();
path.Should().HaveCount(1);
path.LastSegment.ShouldBeEntitySetSegment(HardCodedTestModel.GetPeopleSet());
uriParser.ParseFilter().Should().BeNull();
var results = uriParser.ParseSelectAndExpand();
results.AllSelected.Should().BeTrue();
results.SelectedItems.Should().HaveCount(0);
uriParser.ParseOrderBy().Should().BeNull();
Action action = () => uriParser.ParseTop();
action.ShouldThrow<ODataException>().WithMessage(Strings.SyntacticTree_InvalidTopQueryOptionValue(""));
action = () => uriParser.ParseSkip();
action.ShouldThrow<ODataException>().WithMessage(Strings.SyntacticTree_InvalidSkipQueryOptionValue(""));
action = () => uriParser.ParseCount();
action.ShouldThrow<ODataException>().WithMessage(Strings.ODataUriParser_InvalidCount(""));
action = () => uriParser.ParseSearch();
action.ShouldThrow<ODataException>().WithMessage(Strings.UriQueryExpressionParser_ExpressionExpected(0, ""));
uriParser.ParseSkipToken().Should().BeEmpty();
uriParser.ParseDeltaToken().Should().BeEmpty();
}
示例3: ParseQueryOptionsShouldWork
public void ParseQueryOptionsShouldWork()
{
var parser = new ODataUriParser(HardCodedTestModel.TestModel, new Uri("People?$filter=MyDog/Color eq 'Brown'&$select=ID&$expand=MyDog&$orderby=ID&$top=1&$skip=2&$count=true&$search=FA&$unknow=&$unknowvalue&$skiptoken=abc&$deltatoken=def", UriKind.Relative));
parser.ParseSelectAndExpand().Should().NotBeNull();
parser.ParseFilter().Should().NotBeNull();
parser.ParseOrderBy().Should().NotBeNull();
parser.ParseTop().Should().Be(1);
parser.ParseSkip().Should().Be(2);
parser.ParseCount().Should().Be(true);
parser.ParseSearch().Should().NotBeNull();
parser.ParseSkipToken().Should().Be("abc");
parser.ParseDeltaToken().Should().Be("def");
}