File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
tests/Testcontainers.Databases.Tests Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,19 @@ public static TheoryData<Type> GetContainerImplementations(bool expectDataProvid
4040 // TODO: If a module contains multiple container implementations, it would require all container implementations to implement the interface.
4141 foreach ( var containerType in testAssembly . Value . Where ( type => type . IsAssignableTo ( typeof ( IContainer ) ) ) )
4242 {
43+ var testAssemblyName = testAssembly . Key . GetName ( ) . Name ! ;
44+
45+ var containerTypeAssemblyName = containerType . Assembly . GetName ( ) . Name ! ;
46+
47+ // If a module utilizes another one of our modules, do not include the container type
48+ // if it does not belong to the actual module. For example, the ServiceBus module
49+ // utilizes the MsSql module. We do not want to include the MsSqlContainer type
50+ // twice or place it in the wrong test.
51+ if ( ! testAssemblyName . Contains ( containerTypeAssemblyName , StringComparison . OrdinalIgnoreCase ) )
52+ {
53+ continue ;
54+ }
55+
4356 var hasDataProvider = testAssembly . Value . Exists ( type => type . IsSubclassOf ( typeof ( DbProviderFactory ) ) ) ;
4457
4558 if ( expectDataProvider && hasDataProvider )
You can’t perform that action at this time.
0 commit comments