當前位置: 首頁>>代碼示例>>C#>>正文


C# ValueCursor.MoveNext方法代碼示例

本文整理匯總了C#中NodaTime.Text.ValueCursor.MoveNext方法的典型用法代碼示例。如果您正苦於以下問題:C# ValueCursor.MoveNext方法的具體用法?C# ValueCursor.MoveNext怎麽用?C# ValueCursor.MoveNext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NodaTime.Text.ValueCursor的用法示例。


在下文中一共展示了ValueCursor.MoveNext方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: ParseInt64_MinValue

 public void ParseInt64_MinValue()
 {
     var value = new ValueCursor("-9223372036854775808");
     Assert.True(value.MoveNext());
     long result;
     Assert.IsNull(value.ParseInt64<string>(out result));
     Assert.AreEqual(long.MinValue, result);
 }
開發者ID:ivandrofly,項目名稱:nodatime,代碼行數:8,代碼來源:ValueCursorTest.cs

示例13: ParseInt64_NumberOutOfRange_MinValueLeadingDigits

 public void ParseInt64_NumberOutOfRange_MinValueLeadingDigits()
 {
     var value = new ValueCursor("-9223372036854775809");
     Assert.True(value.MoveNext());
     long result;
     Assert.IsNotNull(value.ParseInt64<string>(out result));
     // Cursor has not moved
     Assert.AreEqual(0, value.Index);
 }
開發者ID:ivandrofly,項目名稱:nodatime,代碼行數:9,代碼來源:ValueCursorTest.cs

示例14: ParseInt64_NegativeThenNonDigit

 public void ParseInt64_NegativeThenNonDigit()
 {
     var value = new ValueCursor("-x");
     Assert.True(value.MoveNext());
     long result;
     Assert.IsNotNull(value.ParseInt64<string>(out result));
     // Cursor has not moved
     Assert.AreEqual(0, value.Index);
 }
開發者ID:ivandrofly,項目名稱:nodatime,代碼行數:9,代碼來源:ValueCursorTest.cs

示例15: TestParseDigit_successMinimumNonDigits

 public void TestParseDigit_successMinimumNonDigits()
 {
     var value = new ValueCursor("1abc");
     Assert.True(value.MoveNext());
     int actual;
     Assert.True(value.ParseDigits(1, 2, out actual));
     Assert.AreEqual(1, actual);
     ValidateCurrentCharacter(value, 1, 'a');
 }
開發者ID:manirana007,項目名稱:NodaTime,代碼行數:9,代碼來源:ValueCursorTest.cs


注:本文中的NodaTime.Text.ValueCursor.MoveNext方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。