File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ public void InsertAllFailureInsideTransaction()
123123 }
124124
125125 [ Test ]
126- public void InsertAllFailureOutsideTransaction ( )
126+ public void InsertAllFailureInTransaction2 ( )
127127 {
128128 var testObjects = Enumerable . Range ( 1 , 20 ) . Select ( i => new UniqueObj { Id = i } ) . ToList ( ) ;
129129 testObjects [ ^ 1 ] . Id = 1 ; // causes the insert to fail because of duplicate key
@@ -133,6 +133,22 @@ public void InsertAllFailureOutsideTransaction()
133133 Assert . AreEqual ( 0 , _db . Table < UniqueObj > ( ) . Count ( ) ) ;
134134 }
135135
136+ [ Test ]
137+ public void InsertAllFailureInTransaction3 ( )
138+ {
139+ var testObjects = Enumerable . Range ( 1 , 20 ) . Select ( i => new UniqueObj { Id = i } ) . ToList ( ) ;
140+ testObjects [ ^ 1 ] . Id = 1 ; // causes the insert to fail because of duplicate key
141+
142+ ExceptionAssert . Throws < SQLiteException > ( ( ) =>
143+ {
144+ _db . BeginTransaction ( ) ;
145+ _db . InsertAll ( testObjects ) ;
146+ _db . Commit ( ) ;
147+ } ) ;
148+
149+ Assert . AreEqual ( 0 , _db . Table < UniqueObj > ( ) . Count ( ) ) ;
150+ }
151+
136152 [ Test ]
137153 public void InsertAllFailureSucceedsOutsideTransaction ( )
138154 {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ if ($IsMacOS) {
77 $msbuild = join-path $msbuild ' MSBuild\Current\Bin\MSBuild.exe'
88}
99$version = " 2.1.0"
10- $versionSuffix = " -pre3 "
10+ $versionSuffix = " -pre4 "
1111
1212# ####################
1313# Build release config
You can’t perform that action at this time.
0 commit comments