示例#1
0
文件: Assertion.cs 项目: rexzh/RexToy
 public static void IsTrue(bool val, string msg, params object[] args)
 {
     if (!val)
     {
         throw new AssertException(msg.TryFormat(args) + Assertion.CallPosition());
     }
 }
示例#2
0
文件: Assertion.cs 项目: rexzh/RexToy
 public static void IsNull(object val, string msg, params object[] args)
 {
     if (val != null)
     {
         throw new AssertException(msg.TryFormat(args) + Assertion.CallPosition());
     }
 }
示例#3
0
文件: Assertion.cs 项目: rexzh/RexToy
 public static void AreEqual(object expected, object result, string msg, params object[] args)
 {
     if (!expected.Equals(result))
     {
         throw new AssertException(msg.TryFormat(args) + Assertion.CallPosition());
     }
 }
示例#4
0
文件: Assertion.cs 项目: rexzh/RexToy
 public static void Fail(string msg, params object[] args)
 {
     throw new AssertException(msg.TryFormat(args) + Assertion.CallPosition());
 }