本文整理汇总了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);
}