@@ -473,4 +473,48 @@ public async Task BulkUpsertImporter_ThrowsOnNonexistentTable()
473473
474474 await Assert . ThrowsAsync < YdbException > ( async ( ) => { await importer . FlushAsync ( ) ; } ) ;
475475 }
476+
477+ [ Fact ]
478+ public void EnableImplicitSession_WhenSetViaPrimaryKey_ParsesAndAppearsInConnectionString ( )
479+ {
480+ var csb = new YdbConnectionStringBuilder ( "EnableImplicitSession=true;Host=server;Port=2135;" ) ;
481+ Assert . True ( csb . EnableImplicitSession ) ;
482+
483+ Assert . Contains ( "EnableImplicitSession=True" , csb . ConnectionString ) ;
484+ Assert . Contains ( "Host=server" , csb . ConnectionString ) ;
485+ Assert . Contains ( "Port=2135" , csb . ConnectionString ) ;
486+ }
487+
488+ [ Fact ]
489+ public void EnableImplicitSession_WhenSetViaAlias_ParsesAndNormalizesKey ( )
490+ {
491+ var csb = new YdbConnectionStringBuilder ( "ImplicitSession=on;Host=server;Port=2135;" ) ;
492+ Assert . True ( csb . EnableImplicitSession ) ;
493+
494+ var s = csb . ConnectionString ;
495+
496+ Assert . Contains ( "EnableImplicitSession=True" , s ) ;
497+
498+ var parts = s . Split ( ';' , StringSplitOptions . RemoveEmptyEntries | StringSplitOptions . TrimEntries ) ;
499+ Assert . DoesNotContain ( parts , p => p . StartsWith ( "ImplicitSession=" , StringComparison . OrdinalIgnoreCase ) ) ;
500+
501+ Assert . Contains ( "Host=server" , s ) ;
502+ Assert . Contains ( "Port=2135" , s ) ;
503+ }
504+
505+ [ Theory ]
506+ [ InlineData ( "true" , true ) ]
507+ [ InlineData ( "True" , true ) ]
508+ [ InlineData ( "on" , true ) ]
509+ [ InlineData ( "1" , true ) ]
510+ [ InlineData ( "false" , false ) ]
511+ [ InlineData ( "False" , false ) ]
512+ [ InlineData ( "off" , false ) ]
513+ [ InlineData ( "0" , false ) ]
514+ public void EnableImplicitSession_StringBooleanVariants_AreParsed ( string value , bool expected )
515+ {
516+ var csb = new YdbConnectionStringBuilder ( $ "EnableImplicitSession={ value } ;") ;
517+ Assert . Equal ( expected , csb . EnableImplicitSession ) ;
518+ Assert . Contains ( $ "EnableImplicitSession={ ( expected ? "True" : "False" ) } ", csb . ConnectionString ) ;
519+ }
476520}
0 commit comments