Browse Source

fcl-db: tests: cosmetic + correct typos

git-svn-id: trunk@29451 -
lacak 10 years ago
parent
commit
d033c7e122
1 changed files with 17 additions and 23 deletions
  1. 17 23
      packages/fcl-db/tests/testsqldb.pas

+ 17 - 23
packages/fcl-db/tests/testsqldb.pas

@@ -31,7 +31,6 @@ type
   private
   private
     FMyQ: TSQLQuery;
     FMyQ: TSQLQuery;
     procedure DoAfterPost(DataSet: TDataSet);
     procedure DoAfterPost(DataSet: TDataSet);
-    Procedure Allow;
     Procedure DoApplyUpdates;
     Procedure DoApplyUpdates;
     Procedure SetQueryOptions;
     Procedure SetQueryOptions;
     Procedure TrySetPacketRecords;
     Procedure TrySetPacketRecords;
@@ -87,16 +86,6 @@ implementation
 
 
 { TTestTSQLQuery }
 { TTestTSQLQuery }
 
 
-procedure TTestTSQLQuery.DoAfterPost(DataSet: TDataSet);
-begin
-  AssertTrue('Have modifications in after post',FMyq.UpdateStatus=usModified)
-end;
-
-Procedure TTestTSQLQuery.Allow;
-begin
-
-end;
-
 procedure TTestTSQLQuery.TestMasterDetail;
 procedure TTestTSQLQuery.TestMasterDetail;
 var MasterQuery, DetailQuery: TSQLQuery;
 var MasterQuery, DetailQuery: TSQLQuery;
     MasterSource: TDataSource;
     MasterSource: TDataSource;
@@ -264,6 +253,11 @@ begin
     end;
     end;
 end;
 end;
 
 
+procedure TTestTSQLQuery.DoAfterPost(DataSet: TDataSet);
+begin
+  AssertTrue('Have modifications in after post',FMyq.UpdateStatus=usModified)
+end;
+
 Procedure TTestTSQLQuery.TestAutoApplyUpdatesPost;
 Procedure TTestTSQLQuery.TestAutoApplyUpdatesPost;
 var Q: TSQLQuery;
 var Q: TSQLQuery;
     I: Integer;
     I: Integer;
@@ -416,10 +410,10 @@ begin
   Q.Insert;
   Q.Insert;
   Q.FieldByName('id').AsInteger:=1;
   Q.FieldByName('id').AsInteger:=1;
   Q.Post;
   Q.Post;
-  AssertTrue('field value has not been fetched after post',Q.FieldByName('a').IsNull);
+  AssertTrue('Field value has not been fetched after post',Q.FieldByName('a').IsNull);
   Q.ApplyUpdates(0);
   Q.ApplyUpdates(0);
-  AssertEquals('Still on correc field',1,Q.FieldByName('id').AsInteger);
-  AssertEquals('field value has been fetched from the database ','abcde',Q.FieldByName('a').AsString);
+  AssertEquals('Still on correct field',1,Q.FieldByName('id').AsInteger);
+  AssertEquals('Field value has been fetched from the database ','abcde',Q.FieldByName('a').AsString);
 end;
 end;
 
 
 Procedure TTestTSQLQuery.TestGeneratedRefreshSQL;
 Procedure TTestTSQLQuery.TestGeneratedRefreshSQL;
@@ -448,11 +442,11 @@ begin
   Q.Insert;
   Q.Insert;
   Q.FieldByName('id').AsInteger:=1;
   Q.FieldByName('id').AsInteger:=1;
   Q.Post;
   Q.Post;
-  AssertTrue('field value has not been fetched after post',Q.FieldByName('a').IsNull);
+  AssertTrue('Field value has not been fetched after post',Q.FieldByName('a').IsNull);
   Q.ApplyUpdates(0);
   Q.ApplyUpdates(0);
-  AssertEquals('Still on correc field',1,Q.FieldByName('id').AsInteger);
-  AssertEquals('field value has been fetched from the database ','abcde',Q.FieldByName('a').AsString);
-  AssertEquals('field value has been fetched from the database ','fgh',Q.FieldByName('b').AsString);
+  AssertEquals('Still on correct field',1,Q.FieldByName('id').AsInteger);
+  AssertEquals('Field value has been fetched from the database ','abcde',Q.FieldByName('a').AsString);
+  AssertEquals('Field value has been fetched from the database ','fgh',Q.FieldByName('b').AsString);
 end;
 end;
 
 
 Procedure TTestTSQLQuery.TestGeneratedRefreshSQL1Field;
 Procedure TTestTSQLQuery.TestGeneratedRefreshSQL1Field;
@@ -478,11 +472,11 @@ begin
   Q.Insert;
   Q.Insert;
   Q.FieldByName('id').AsInteger:=1;
   Q.FieldByName('id').AsInteger:=1;
   Q.Post;
   Q.Post;
-  AssertTrue('field value has not been fetched after post',Q.FieldByName('a').IsNull);
+  AssertTrue('Field value has not been fetched after post',Q.FieldByName('a').IsNull);
   Q.ApplyUpdates(0);
   Q.ApplyUpdates(0);
-  AssertEquals('Still on correc field',1,Q.FieldByName('id').AsInteger);
-  AssertEquals('field value a has been fetched from the database ','abcde',Q.FieldByName('a').AsString);
-  AssertEquals('field value b has NOT been fetched from the database ','',Q.FieldByName('b').AsString);
+  AssertEquals('Still on correct field',1,Q.FieldByName('id').AsInteger);
+  AssertEquals('Field value a has been fetched from the database ','abcde',Q.FieldByName('a').AsString);
+  AssertEquals('Field value b has NOT been fetched from the database ','',Q.FieldByName('b').AsString);
 end;
 end;
 
 
 Procedure TTestTSQLQuery.TestGeneratedRefreshSQLNoKey;
 Procedure TTestTSQLQuery.TestGeneratedRefreshSQLNoKey;
@@ -560,7 +554,7 @@ begin
   FMyQ.Insert;
   FMyQ.Insert;
   FMyQ.FieldByName('id').AsInteger:=1;
   FMyQ.FieldByName('id').AsInteger:=1;
   FMyQ.Post;
   FMyQ.Post;
-  AssertException('Multiple records returned by RefreshSQL gives an error',EUpdateError,@DoApplyUpdates);
+  AssertException('No records returned by RefreshSQL gives an error',EUpdateError,@DoApplyUpdates);
 end;
 end;
 
 
 Procedure TTestTSQLQuery.TestFetchAutoInc;
 Procedure TTestTSQLQuery.TestFetchAutoInc;