Browse Source

* Added more Delphi-compatibility wrappers

git-svn-id: trunk@19908 -
joost 13 years ago
parent
commit
5698d75c4c
1 changed files with 9 additions and 2 deletions
  1. 9 2
      packages/fcl-fpcunit/src/DUnitCompatibleInterface.inc

+ 9 - 2
packages/fcl-fpcunit/src/DUnitCompatibleInterface.inc

@@ -20,8 +20,9 @@
     class procedure CheckIs(obj :TObject; pClass: TClass; msg: string = ''); overload;
     class procedure CheckIs(obj :TObject; pClass: TClass; msg: string = ''); overload;
     class procedure CheckSame(expected, actual: TObject; msg: string = ''); overload;
     class procedure CheckSame(expected, actual: TObject; msg: string = ''); overload;
     class procedure FailNotEquals(expected, actual: string; msg: string = ''; errorAddr: Pointer = nil); virtual;
     class procedure FailNotEquals(expected, actual: string; msg: string = ''; errorAddr: Pointer = nil); virtual;
-    class procedure CheckTrue(condition: Boolean; msg: string);
-    class procedure CheckFalse(condition: Boolean; msg: string);
+    class procedure CheckTrue(condition: Boolean; msg: string = '');
+    class procedure CheckFalse(condition: Boolean; msg: string = '');
+    class procedure CheckException(AMethod: TRunMethod; AExceptionClass: ExceptClass; msg: string = '');
     class function  EqualsErrorMessage(const expected, actual: string; const ErrorMsg: string): string;
     class function  EqualsErrorMessage(const expected, actual: string; const ErrorMsg: string): string;
     class function  NotEqualsErrorMessage(const expected, actual: string; const ErrorMsg: string): string;
     class function  NotEqualsErrorMessage(const expected, actual: string; const ErrorMsg: string): string;
 
 
@@ -158,6 +159,12 @@ begin
       FailNotEquals(BoolToStr(false, true), BoolToStr(true, true), msg, nil);
       FailNotEquals(BoolToStr(false, true), BoolToStr(true, true), msg, nil);
 end;
 end;
 
 
+
+class procedure TAssert.CheckException(AMethod: TRunMethod; AExceptionClass: ExceptClass; msg: string = '');
+begin
+  AssertException(msg, AExceptionClass, AMethod);
+end;
+
 class function TAssert.EqualsErrorMessage(const expected, actual: string;
 class function TAssert.EqualsErrorMessage(const expected, actual: string;
     const ErrorMsg: string): string;
     const ErrorMsg: string): string;
 begin
 begin