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