sitecore 确保值是对还是错
本文向大家介绍sitecore 确保值是对还是错,包括了sitecore 确保值是对还是错的使用技巧和注意事项,需要的朋友参考一下
示例
要断言值是true还是false,请执行以下操作:
Assert.IsFalse(Settings.DoBadThings, "Bad things should not happen, disable DoBadThings."); Assert.IsTrue(magicNumber =< 42, "魔数大于42!");
您还可以为异常消息传递格式化参数
Assert.IsFalse(myValue > 5, "The value should not be greater than 5, it's currently {0}", myValue);