当前位置: 首页>>代码示例>>C#>>正文


C# Text.ValueCursor类代码示例

本文整理汇总了C#中NodaTime.Text.ValueCursor的典型用法代码示例。如果您正苦于以下问题:C# ValueCursor类的具体用法?C# ValueCursor怎么用?C# ValueCursor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ValueCursor类属于NodaTime.Text命名空间,在下文中一共展示了ValueCursor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MatchCaseInsensitive_MatchAndMove

 public void MatchCaseInsensitive_MatchAndMove()
 {
     var value = new ValueCursor("abcd");
     Assert.True(value.MoveNext(), "GetNext() 1");
     Assert.True(value.MatchCaseInsensitive("AbC", CultureInfo.InvariantCulture.CompareInfo, true));
     ValidateCurrentCharacter(value, 3, 'd');
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:7,代码来源:ValueCursorTest.cs

示例2: MatchCaseInsensitive_StringNotMatched

 public void MatchCaseInsensitive_StringNotMatched()
 {
     var value = new ValueCursor("xabcdef");
     Assert.True(value.MoveNext(), "GetNext() 1");
     Assert.False(value.MatchCaseInsensitive("abc", CultureInfo.InvariantCulture.CompareInfo, true));
     ValidateCurrentCharacter(value, 0, 'x');
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:7,代码来源:ValueCursorTest.cs

示例3: Match_String

 public void Match_String()
 {
     var value = new ValueCursor("abc");
     Assert.True(value.MoveNext(), "GetNext() 1");
     Assert.True(value.Match("abc"));
     Assert.False(value.MoveNext(), "GetNext() end");
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:7,代码来源:ValueCursorTest.cs

示例4: TestMatchCaseInsensitive_string

 public void TestMatchCaseInsensitive_string()
 {
     var value = new ValueCursor("abc");
     Assert.True(value.MoveNext(), "GetNext() 1");
     Assert.True(value.MatchCaseInsensitive("AbC", CultureInfo.InvariantCulture.CompareInfo));
     Assert.False(value.MoveNext(), "GetNext() end");
 }
开发者ID:manirana007,项目名称:NodaTime,代码行数:7,代码来源:ValueCursorTest.cs

示例5: Match_StringNotMatched

 public void Match_StringNotMatched()
 {
     var value = new ValueCursor("xabcdef");
     Assert.True(value.MoveNext(), "GetNext() 1");
     Assert.False(value.Match("abc"));
     ValidateCurrentCharacter(value, 0, 'x');
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:7,代码来源:ValueCursorTest.cs

示例6: Match_StringOverLongStringToMatch

 public void Match_StringOverLongStringToMatch()
 {
     var value = new ValueCursor("x");
     Assert.True(value.MoveNext());
     Assert.False(value.Match("long string"));
     ValidateCurrentCharacter(value, 0, 'x');
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:7,代码来源:ValueCursorTest.cs

示例7: Parse_Partial_Invalid

 public void Parse_Partial_Invalid()
 {
     var value = new ValueCursor("x17:y");
     value.MoveNext();
     value.MoveNext();
     var result = SimpleOffsetPattern.ParsePartial(value);
     Assert.Throws<UnparsableValueException>(() => result.GetValueOrThrow());
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:8,代码来源:SteppedPatternBuilderTest.cs

示例8: MatchCaseInsensitive_MatchWithoutMoving

 public void MatchCaseInsensitive_MatchWithoutMoving()
 {
     var value = new ValueCursor("abcd");
     Assert.True(value.MoveNext(), "GetNext() 1");
     Assert.True(value.MatchCaseInsensitive("AbC", CultureInfo.InvariantCulture.CompareInfo, false));
     // We're still looking at the start
     ValidateCurrentCharacter(value, 0, 'a');
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:8,代码来源:ValueCursorTest.cs

示例9: Match_Char

 public void Match_Char()
 {
     var value = new ValueCursor("abc");
     Assert.True(value.MoveNext(), "GetNext() 1");
     Assert.True(value.Match('a'), "First character");
     Assert.True(value.Match('b'), "Second character");
     Assert.True(value.Match('c'), "Third character");
     Assert.False(value.MoveNext(), "GetNext() end");
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:9,代码来源:ValueCursorTest.cs

示例10: ParsePartial_ValidAtEnd

 public void ParsePartial_ValidAtEnd()
 {
     var value = new ValueCursor("x17:30");
     value.MoveNext();
     value.MoveNext();
     var result = SimpleOffsetPattern.ParsePartial(value);
     Assert.AreEqual(Offset.FromHoursAndMinutes(17, 30), result.Value);
     // Finish just after the value, which in this case is at the end.
     Assert.AreEqual(TextCursor.Nul, value.Current);
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:10,代码来源:SteppedPatternBuilderTest.cs

示例11: ParsePartial_ValidInMiddle

 public void ParsePartial_ValidInMiddle()
 {
     var value = new ValueCursor("x17:30y");
     value.MoveNext();
     value.MoveNext();
     // Start already looking at the value to parse
     Assert.AreEqual('1', value.Current);
     var result = SimpleOffsetPattern.ParsePartial(value);
     Assert.AreEqual(Offset.FromHoursAndMinutes(17, 30), result.Value);
     // Finish just after the value
     Assert.AreEqual('y', value.Current);
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:12,代码来源:SteppedPatternBuilderTest.cs

示例12: CompareOrdinal_LongMatch_ValueIsEarlier

 public void CompareOrdinal_LongMatch_ValueIsEarlier()
 {
     var value = new ValueCursor("xabc");
     value.Move(1);
     Assert.Less(value.CompareOrdinal("cccc"), 0);
     Assert.AreEqual(1, value.Index); // Cursor hasn't moved
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:7,代码来源:ValueCursorTest.cs

示例13: CompareOrdinal_LongMatch_ValueIsLater

 public void CompareOrdinal_LongMatch_ValueIsLater()
 {
     var value = new ValueCursor("xabc");
     value.Move(1);
     Assert.Greater(value.CompareOrdinal("aaaa"), 0);
     Assert.AreEqual(1, value.Index); // Cursor hasn't moved
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:7,代码来源:ValueCursorTest.cs

示例14: ParseInt64Digits_TooFewDigits

 public void ParseInt64Digits_TooFewDigits()
 {
     var value = new ValueCursor("a12b");
     Assert.True(value.MoveNext());
     ValidateCurrentCharacter(value, 0, 'a');
     Assert.True(value.MoveNext());
     long actual;
     Assert.False(value.ParseInt64Digits(3, 3, out actual));
     ValidateCurrentCharacter(value, 1, '1');
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:10,代码来源:ValueCursorTest.cs

示例15: CompareOrdinal_ExactMatchValueContinues

 public void CompareOrdinal_ExactMatchValueContinues()
 {
     var value = new ValueCursor("xabc");
     value.Move(1);
     Assert.AreEqual(0, value.CompareOrdinal("ab"));
     Assert.AreEqual(1, value.Index); // Cursor hasn't moved
 }
开发者ID:ivandrofly,项目名称:nodatime,代码行数:7,代码来源:ValueCursorTest.cs


注:本文中的NodaTime.Text.ValueCursor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。