33using Dapper ;
44using Xunit ;
55using Ydb . Sdk . Ado ;
6+ using Ydb . Sdk . Tests . Ado . Specification ;
7+ using Ydb . Sdk . Tests . Fixture ;
68
79namespace Ydb . Sdk . Tests . Dapper ;
810
9- public class DapperIntegrationTests
11+ public class DapperIntegrationTests : YdbAdoNetFixture
1012{
1113 private static readonly TemporaryTables < DapperIntegrationTests > Tables = new ( ) ;
1214
@@ -23,12 +25,9 @@ public async Task DapperYqlTutorialTests()
2325 . OfType < ColumnAttribute > ( )
2426 . Any ( attr => attr . Name == columnName ) ) ?? throw new InvalidOperationException ( ) ) ) ;
2527
26- await using var connection = new YdbConnection ( ) ;
27- await connection . OpenAsync ( ) ;
28-
28+ await using var connection = await CreateOpenConnectionAsync ( ) ;
2929 await connection . ExecuteAsync ( Tables . CreateTables ) ; // create tables
3030 await connection . ExecuteAsync ( Tables . UpsertData ) ; // adding data to table
31-
3231 var selectedEpisodes = ( await connection . QueryAsync < Episode > ( $@ "
3332SELECT
3433 series_id,
@@ -206,7 +205,7 @@ public async Task NullableFieldSupported()
206205 {
207206 var tableName = "DapperNullableTypes_" + Random . Shared . Next ( ) ;
208207
209- await using var connection = new YdbConnection ( ) ;
208+ await using var connection = await CreateOpenConnectionAsync ( ) ;
210209 await connection . ExecuteAsync ( @$ "
211210CREATE TABLE { tableName } (
212211 Id INT32,
@@ -270,4 +269,8 @@ private record Episode
270269 [ Column ( "title" ) ] public string Title { get ; init ; } = null ! ;
271270 [ Column ( "air_date" ) ] public DateTime AirDate { get ; init ; }
272271 }
272+
273+ protected DapperIntegrationTests ( YdbFactoryFixture fixture ) : base ( fixture )
274+ {
275+ }
273276}
0 commit comments