首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 流利的例外声明

流利的例外声明

  • 资源大小:12.22 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: 例外

资 源 简 介

NAsserter Provides a fluent interface for code level assertions. Supports .Net 2.0 and above. Example Instead of following traditional conventions for asserting exceptions in code: ``` public void DoSomething(Customer arg1, int? arg2) { if (arg1 != null) throw new ArgumentNullException("arg1"); if (arg1.CreatedDate >= DateTime.Parse("01-01-2009") && arg1.CreatedDate <= DateTime.Parse("01-01-2010") throw new ArgumentOutOfRangeException("Argument (arg1.CreatedDate) must be between 01-01-2009 and 01-01-2010", "arg1"); if (arg2.HasValue) throw new ArgumentNullException("arg2"); if (arg2.Value == 2 || arg2.Value == 3 || arg2.Value == 4) throw new ArgumentOutOfRangeException("Argument (arg2) must 2, 3, 4", "arg2"); ``` You can follow a fluent convention such as: public void DoSomething(Customer arg1, int? arg2){ Asser

文 件 列 表

NAsserter.dll
NAsserter.pdb

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP