示例#1
0
 internal void IsEquals(string message, long a, long b)
 {
     if (a != b)
     {
         throw new TestFailedException(SimpleTestResult.Failed(this, message));
     }
 }
 internal void Fail(
     string message,
     object expected,
     object found)
 {
     throw new TestFailedException(SimpleTestResult.Failed(this, message, expected, found));
 }
示例#3
0
 internal void IsEquals(int a, int b)
 {
     if (a != b)
     {
         throw new TestFailedException(SimpleTestResult.Failed(this, "no message"));
     }
 }
示例#4
0
 internal void IsEquals(object a, object b)
 {
     if (!a.Equals(b))
     {
         throw new TestFailedException(SimpleTestResult.Failed(this, "no message"));
     }
 }
示例#5
0
 internal void IsTrue(string message, bool value)
 {
     if (!value)
     {
         throw new TestFailedException(SimpleTestResult.Failed(this, message));
     }
 }
示例#6
0
 internal void IsTrue(bool value)
 {
     if (!value)
     {
         throw new TestFailedException(SimpleTestResult.Failed(this, "no message"));
     }
 }
        public virtual ITestResult Perform()
        {
            try
            {
                PerformTest();

                return(Success());
            }
            catch (TestFailedException e)
            {
                return(e.GetResult());
            }
            catch (Exception e)
            {
                return(SimpleTestResult.Failed(this, "Exception: " + e, e));
            }
        }
示例#8
0
        internal void IsEquals(string message, object a, object b)
        {
            if (a == null && b == null)
            {
                return;
            }

            if (a == null)
            {
                throw new TestFailedException(SimpleTestResult.Failed(this, message));
            }
            if (b == null)
            {
                throw new TestFailedException(SimpleTestResult.Failed(this, message));
            }
            if (!a.Equals(b))
            {
                throw new TestFailedException(SimpleTestResult.Failed(this, message));
            }
        }
 internal void Fail(
     string message,
     Exception throwable)
 {
     throw new TestFailedException(SimpleTestResult.Failed(this, message, throwable));
 }
示例#10
0
 private ITestResult Success()
 {
     return(SimpleTestResult.Successful(this, "Okay"));
 }