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)); }
internal void IsEquals(int a, int b) { if (a != b) { throw new TestFailedException(SimpleTestResult.Failed(this, "no message")); } }
internal void IsEquals(object a, object b) { if (!a.Equals(b)) { throw new TestFailedException(SimpleTestResult.Failed(this, "no message")); } }
internal void IsTrue(string message, bool value) { if (!value) { throw new TestFailedException(SimpleTestResult.Failed(this, message)); } }
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)); } }
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)); }
private ITestResult Success() { return(SimpleTestResult.Successful(this, "Okay")); }