本文整理匯總了C#中NodaTime.Text.ValueCursor.Match方法的典型用法代碼示例。如果您正苦於以下問題:C# ValueCursor.Match方法的具體用法?C# ValueCursor.Match怎麽用?C# ValueCursor.Match使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NodaTime.Text.ValueCursor
的用法示例。
在下文中一共展示了ValueCursor.Match方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: 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");
}
示例2: 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');
}
示例3: 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');
}
示例4: 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");
}
示例5: Match_StringPartial
public void Match_StringPartial()
{
var value = new ValueCursor("abcdef");
Assert.True(value.MoveNext(), "GetNext() 1");
Assert.True(value.Match("abc"));
ValidateCurrentCharacter(value, 3, 'd');
}