Skip to content

Commit 8b4d748

Browse files
committed
pre4
1 parent ba7b5c9 commit 8b4d748

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

SQLite.Net.Tests/InsertTest.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff 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
{

nuget/pack.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)