コード例 #1
0
        public void Test001()
        {
            int x = 10;

            assert.Check(() => x == 10); // success
            assert.Check(() => x == 20); // failure
        }
コード例 #2
0
 public static void AreNotSame(this IAssertionTool tool, object expected, object actual, string msg, params object[] fmt)
 {
     tool.Check(() => expected, () => actual, (a, b) => !object.ReferenceEquals(a, b), null, msg, fmt);
 }
コード例 #3
0
 public static void Check(this IAssertionTool assertTool, Expression <Func <bool> > test, string msg)
 {
     assertTool.Check(test, null, "{0}", msg);
 }
コード例 #4
0
        public static void IsFalse(this IAssertionTool assertTool, Expression <Func <bool> > test)
        {
            test = Expression.Lambda <Func <bool> >(Expression.Not(test.Body));

            assertTool.Check(test);
        }
コード例 #5
0
 public static void IsTrue(this IAssertionTool assertTool, Expression <Func <bool> > test, string msg)
 {
     assertTool.Check(test, msg);
 }
コード例 #6
0
 public static void AreNotEqual <T>(this IAssertionTool tool, T expected, Expression <Func <T> > actual)
     where T : class
 {
     tool.Check(() => expected, actual, (a, b) => !object.Equals(a, b));
 }
コード例 #7
0
 public static void AreNotSame(this IAssertionTool tool, Expression <Func <object> > expected, Expression <Func <object> > actual, string msg, params object[] fmt)
 {
     tool.Check(expected, actual, (a, b) => !object.ReferenceEquals(a, b), null, msg, fmt);
 }
コード例 #8
0
 public static void AreSame(this IAssertionTool tool, Expression <Func <object> > expected, Expression <Func <object> > actual, string msg)
 {
     tool.Check(expected, actual, (a, b) => object.ReferenceEquals(a, b), null, "{0}", msg);
 }
コード例 #9
0
 public static void IsInstanceOf(this IAssertionTool assert, Type t, Expression <Func <object> > expr, string msg)
 {
     assert.Check(() => t, expr, (a, b) => a.IsAssignableFrom(b.GetType()), null, "{0}", msg);
 }
コード例 #10
0
 public static void IsInstanceOf <T>(this IAssertionTool assert, Expression <Func <object> > expr)
 {
     assert.Check(() => typeof(T), expr, (a, b) => a.IsAssignableFrom(b.GetType()));
 }
コード例 #11
0
 public static void IsNotNull <T>(this IAssertionTool assertTool, Expression <Func <T> > test, string msg, params object[] fmt)
     where T : class
 {
     assertTool.Check <T, T>(() => null, test, (expected, actual) => expected != actual, msg, fmt);
 }
コード例 #12
0
 public static void IsNotNull <T>(this IAssertionTool assertTool, Expression <Func <T> > test)
     where T : class
 {
     assertTool.Check <T, T>(() => null, test, (expected, actual) => expected != actual);
 }
コード例 #13
0
 public static void Check <T1, T2>(this IAssertionTool assertTool, Expression <Func <T1> > expected1, Expression <Func <T2> > actual1, Expression <Func <T1, T2, bool> > test, string msg, params object[] fmt)
 {
     assertTool.Check(expected1, actual1, test, null, msg, fmt);
 }
コード例 #14
0
 public static void Check <T1, T2>(this IAssertionTool assertTool, Expression <Func <T1> > expected1, Expression <Func <T2> > actual1, Expression <Func <T1, T2, bool> > test, string msg)
 {
     assertTool.Check(expected1, actual1, test, null, "{0}", msg);
 }
コード例 #15
0
 public static void Check <T1, T2>(this IAssertionTool assertTool, Expression <Func <T1> > expected1, Expression <Func <T2> > actual1, Expression <Func <T1, T2, bool> > test, Exception exc)
 {
     assertTool.Check(expected1, actual1, test, exc, null, null);
 }
コード例 #16
0
 public static void AreEqual <T>(this IAssertionTool tool, Expression <Func <T> > expected, T actual)
     where T : class
 {
     tool.Check(expected, () => actual, (a, b) => object.Equals(a, b));
 }
コード例 #17
0
 public static void AreNotEqual <T>(this IAssertionTool tool, Expression <Func <T> > expected, Expression <Func <T> > actual, string msg)
     where T : class
 {
     tool.Check(expected, actual, (a, b) => !object.Equals(a, b), null, "{0}", msg);
 }
コード例 #18
0
 public static void IsNotInstanceOf(this IAssertionTool assert, Type t, Expression <Func <object> > expr)
 {
     assert.Check(() => t, expr, (a, b) => !a.IsAssignableFrom(b.GetType()));
 }
コード例 #19
0
 public static void AreNotSame(this IAssertionTool tool, Expression <Func <object> > expected, Expression <Func <object> > actual)
 {
     tool.Check(expected, actual, (a, b) => !object.ReferenceEquals(a, b));
 }
コード例 #20
0
 public static void IsNotInstanceOf(this IAssertionTool assert, Type t, Expression <Func <object> > expr, string msg, params object[] args)
 {
     assert.Check(() => t, expr, (a, b) => !a.IsAssignableFrom(b.GetType()), null, msg, args);
 }
コード例 #21
0
 public static void AreEqual <T>(this IAssertionTool tool, T expected, Expression <Func <T> > actual, string msg, params object[] fmt)
     where T : class
 {
     tool.Check(() => expected, actual, (a, b) => object.Equals(a, b), null, msg, fmt);
 }
コード例 #22
0
 public static void AreEqual <T>(this IAssertionTool tool, T expected, T actual, string msg)
     where T : class
 {
     tool.Check(() => expected, () => actual, (a, b) => object.Equals(a, b), null, "{0}", msg);
 }
コード例 #23
0
 public static void AreNotEqual <T>(this IAssertionTool tool, T expected, T actual, string msg, params object[] fmt)
     where T : class
 {
     tool.Check(() => expected, () => actual, (a, b) => !object.Equals(a, b), null, msg, fmt);
 }
コード例 #24
0
 public static void AreSame(this IAssertionTool tool, object expected, object actual, string msg)
 {
     tool.Check(() => expected, () => actual, (a, b) => object.ReferenceEquals(a, b), null, "{0}", msg);
 }
コード例 #25
0
 public static void IsTrue(this IAssertionTool assertTool, Expression <Func <bool> > test, string msg, params object[] fmt)
 {
     assertTool.Check(test, msg, fmt);
 }
コード例 #26
0
 public static void AreNotSame(this IAssertionTool tool, object expected, object actual)
 {
     tool.Check(() => expected, () => actual, (a, b) => !object.ReferenceEquals(a, b));
 }
コード例 #27
0
        public static void IsFalse(this IAssertionTool assertTool, Expression <Func <bool> > test, string msg, params object[] fmt)
        {
            test = Expression.Lambda <Func <bool> >(Expression.Not(test.Body));

            assertTool.Check(test, msg, fmt);
        }
コード例 #28
0
 public static void Check(this IAssertionTool assertTool, Expression <Func <bool> > test, Exception exc)
 {
     assertTool.Check(test, exc, null);
 }