是否可以在合同中获得DateTime.MaxValue? [英] Is it possible to get DateTime.MaxValue in a contract?
本文介绍了是否可以在合同中获得DateTime.MaxValue?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
参见TestMaxValue;它失败。 TestInt通过。
See TestMaxValue; it fails. TestInt passes.
class Program
{
static void Main(string[] args)
{
}
public DateTime TestMaxValue()
{
Contract.Ensures(Contract.Result<DateTime>() == DateTime.MaxValue);
return DateTime.MaxValue;
}
public int TestInt()
{
Contract.Ensures(Contract.Result<int>() == AnotherClass.MyInt);
return AnotherClass.MyInt;
}
}
class AnotherClass
{
public static readonly int MyInt = 3;
}
推荐答案
缺少合约......
missing contract...
现在已添加。
谢谢,
f
这篇关于是否可以在合同中获得DateTime.MaxValue?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文