File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- namespace Simple . Data . SqlTest
1+ using Simple . Data . Ado ;
2+
3+ namespace Simple . Data . SqlTest
24{
35 using System . Collections . Generic ;
46 using System . Diagnostics ;
@@ -31,6 +33,25 @@ public void BulkInsertUsesSchema()
3133 Assert . AreEqual ( 1000 , list . Count ) ;
3234 }
3335
36+ [ Test ]
37+ public void BulkInsertUsesSchemaAndFireTriggers ( )
38+ {
39+ var db = DatabaseHelper . Open ( ) ;
40+
41+ using ( var tx = db . BeginTransaction ( ) )
42+ {
43+ tx . WithOptions ( new AdoOptions ( commandTimeout : 60000 , fireTriggersOnBulkInserts : true ) ) ;
44+ tx . test . SchemaTable . DeleteAll ( ) ;
45+ tx . test . SchemaTable . Insert ( GenerateItems ( ) ) ;
46+
47+ tx . Commit ( ) ;
48+ }
49+
50+ int rowsWhichWhereUpdatedByTrigger = db . test . SchemaTable . GetCountBy ( Optional : "Modified By Trigger" ) ;
51+
52+ Assert . AreEqual ( 1000 , rowsWhichWhereUpdatedByTrigger ) ;
53+ }
54+
3455 private static IEnumerable < SchemaItem > GenerateItems ( )
3556 {
3657 for ( int i = 0 ; i < 1000 ; i ++ )
You can’t perform that action at this time.
0 commit comments