@@ -689,7 +689,7 @@ internal void TryGetIntegrationDetails_CorrectNameGenerated(Type commandType, st
689689 var command = ( IDbCommand ) Activator . CreateInstance ( commandType ) ! ;
690690 command . CommandText = DbmCommandText ;
691691
692- bool result = DbScopeFactory . TryGetIntegrationDetails ( command . GetType ( ) . FullName , out var actualIntegrationId , out var actualDbType ) ;
692+ bool result = DbScopeFactory . TryGetIntegrationDetails ( [ ] , command . GetType ( ) . FullName , out var actualIntegrationId , out var actualDbType ) ;
693693 Assert . True ( result ) ;
694694 Assert . Equal ( expectedIntegrationName , actualIntegrationId . ToString ( ) ) ;
695695 Assert . Equal ( expectedDbType , actualDbType ) ;
@@ -698,12 +698,13 @@ internal void TryGetIntegrationDetails_CorrectNameGenerated(Type commandType, st
698698 [ Fact ]
699699 internal void TryGetIntegrationDetails_FailsForKnownCommandType ( )
700700 {
701- bool result = DbScopeFactory . TryGetIntegrationDetails ( "InterceptableDbCommand" , out var actualIntegrationId , out var actualDbType ) ;
701+ var defaultDisabledCommands = new TracerSettings ( ) . DisabledAdoNetCommandTypes ;
702+ bool result = DbScopeFactory . TryGetIntegrationDetails ( defaultDisabledCommands , "InterceptableDbCommand" , out var actualIntegrationId , out var actualDbType ) ;
702703 Assert . False ( result ) ;
703704 Assert . False ( actualIntegrationId . HasValue ) ;
704705 Assert . Null ( actualDbType ) ;
705706
706- bool result2 = DbScopeFactory . TryGetIntegrationDetails ( "ProfiledDbCommand" , out var actualIntegrationId2 , out var actualDbType2 ) ;
707+ bool result2 = DbScopeFactory . TryGetIntegrationDetails ( defaultDisabledCommands , "ProfiledDbCommand" , out var actualIntegrationId2 , out var actualDbType2 ) ;
707708 Assert . False ( result2 ) ;
708709 Assert . False ( actualIntegrationId2 . HasValue ) ;
709710 Assert . Null ( actualDbType2 ) ;
@@ -712,18 +713,18 @@ internal void TryGetIntegrationDetails_FailsForKnownCommandType()
712713 [ Fact ]
713714 internal void TryGetIntegrationDetails_FailsForKnownCommandTypes_AndUserDefined ( )
714715 {
715- Tracer . Configure ( TracerSettings . Create ( new Dictionary < string , object > { { ConfigurationKeys . DisabledAdoNetCommandTypes , "SomeFakeDbCommand" } } ) ) ;
716- bool result = DbScopeFactory . TryGetIntegrationDetails ( "InterceptableDbCommand" , out var actualIntegrationId , out var actualDbType ) ;
716+ var disabledCommandTypes = TracerSettings . Create ( new ( ) { { ConfigurationKeys . DisabledAdoNetCommandTypes , "SomeFakeDbCommand" } } ) . DisabledAdoNetCommandTypes ;
717+ bool result = DbScopeFactory . TryGetIntegrationDetails ( disabledCommandTypes , "InterceptableDbCommand" , out var actualIntegrationId , out var actualDbType ) ;
717718 Assert . False ( result ) ;
718719 Assert . False ( actualIntegrationId . HasValue ) ;
719720 Assert . Null ( actualDbType ) ;
720721
721- bool result2 = DbScopeFactory . TryGetIntegrationDetails ( "ProfiledDbCommand" , out var actualIntegrationId2 , out var actualDbType2 ) ;
722+ bool result2 = DbScopeFactory . TryGetIntegrationDetails ( disabledCommandTypes , "ProfiledDbCommand" , out var actualIntegrationId2 , out var actualDbType2 ) ;
722723 Assert . False ( result2 ) ;
723724 Assert . False ( actualIntegrationId2 . HasValue ) ;
724725 Assert . Null ( actualDbType2 ) ;
725726
726- bool result3 = DbScopeFactory . TryGetIntegrationDetails ( "SomeFakeDbCommand" , out var actualIntegrationId3 , out var actualDbType3 ) ;
727+ bool result3 = DbScopeFactory . TryGetIntegrationDetails ( disabledCommandTypes , "SomeFakeDbCommand" , out var actualIntegrationId3 , out var actualDbType3 ) ;
727728 Assert . False ( result3 ) ;
728729 Assert . False ( actualIntegrationId3 . HasValue ) ;
729730 Assert . Null ( actualDbType3 ) ;
@@ -740,7 +741,8 @@ internal void TryGetIntegrationDetails_FailsForKnownCommandTypes_AndUserDefined(
740741 [ InlineData ( "Custom.DB.Command" , "AdoNet" , "db" ) ]
741742 internal void TryGetIntegrationDetails_CustomCommandType ( string commandTypeFullName , string integrationId , string expectedDbType )
742743 {
743- DbScopeFactory . TryGetIntegrationDetails ( commandTypeFullName , out var actualIntegrationId , out var actualDbType ) ;
744+ var defaultDisabledCommands = new TracerSettings ( ) . DisabledAdoNetCommandTypes ;
745+ DbScopeFactory . TryGetIntegrationDetails ( defaultDisabledCommands , commandTypeFullName , out var actualIntegrationId , out var actualDbType ) ;
744746 Assert . Equal ( integrationId , actualIntegrationId ? . ToString ( ) ) ;
745747 Assert . Equal ( expectedDbType , actualDbType ) ;
746748 }
0 commit comments