-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
217 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Norm; | ||
using Npgsql; | ||
using Xunit; | ||
|
||
namespace PostgreSqlUnitTests; | ||
|
||
[Collection("PostgreSqlDatabase")] | ||
public class RowsAffectedUnitTests | ||
{ | ||
private readonly PostgreSqlFixture fixture; | ||
|
||
public RowsAffectedUnitTests(PostgreSqlFixture fixture) | ||
{ | ||
this.fixture = fixture; | ||
} | ||
|
||
[Fact] | ||
public void Execute_Format_Test() | ||
{ | ||
using var connection = new NpgsqlConnection(fixture.ConnectionString); | ||
connection.Execute("create temp table rows_affected_test (t text)"); | ||
|
||
var rowsAffected = connection | ||
.Execute("insert into rows_affected_test values ('foo')") | ||
.GetRecordsAffected(); | ||
|
||
Assert.Equal(1, rowsAffected); | ||
|
||
var inst = connection.Norm(); | ||
inst.Read("select * from rows_affected_test").ToList(); | ||
rowsAffected = inst.GetRecordsAffected(); | ||
|
||
Assert.Equal(1, rowsAffected); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.