@@ -1078,35 +1078,24 @@ from c in db.Customers
10781078 }
10791079
10801080 [ Category ( "JOIN" ) ]
1081- [ TestCase ( true , Description = "This sample explictly joins two tables with a composite key and projects results from both tables." ) ]
1082- [ TestCase ( false , Description = "This sample explictly joins two tables with a composite key and projects results from both tables." ) ]
1083- public async Task DLinqJoin5dAsync ( bool useCrossJoin )
1081+ [ Test ( Description = "This sample explictly joins two tables with a composite key and projects results from both tables." ) ]
1082+ public async Task DLinqJoin5dAsync ( )
10841083 {
1085- if ( useCrossJoin && ! Dialect . SupportsCrossJoin )
1086- {
1087- Assert . Ignore ( "Dialect does not support cross join." ) ;
1088- }
1089-
10901084 var q =
10911085 from c in db . Customers
10921086 join o in db . Orders on
10931087 new { c . CustomerId , HasContractTitle = c . ContactTitle != null } equals
10941088 new { o . Customer . CustomerId , HasContractTitle = o . Customer . ContactTitle != null }
10951089 select new { c . ContactName , o . OrderId } ;
10961090
1097- using ( var substitute = SubstituteDialect ( ) )
10981091 using ( var sqlSpy = new SqlLogSpy ( ) )
10991092 {
1100- ClearQueryPlanCache ( ) ;
1101- substitute . Value . SupportsCrossJoin . Returns ( useCrossJoin ) ;
1102-
11031093 await ( ObjectDumper . WriteAsync ( q ) ) ;
11041094
11051095 var sql = sqlSpy . GetWholeLog ( ) ;
1106- Assert . That ( sql , Does . Contain ( useCrossJoin ? "cross join" : "inner join" ) ) ;
11071096 Assert . That ( GetTotalOccurrences ( sql , "left outer join" ) , Is . EqualTo ( 0 ) ) ;
1108- Assert . That ( GetTotalOccurrences ( sql , "inner join" ) , Is . EqualTo ( useCrossJoin ? 1 : 2 ) ) ;
1109- Assert . That ( GetTotalOccurrences ( sql , "cross join" ) , Is . EqualTo ( useCrossJoin ? 1 : 0 ) ) ;
1097+ Assert . That ( GetTotalOccurrences ( sql , "inner join" ) , Is . EqualTo ( 2 ) ) ;
1098+ Assert . That ( GetTotalOccurrences ( sql , "cross join" ) , Is . EqualTo ( 0 ) ) ;
11101099 }
11111100 }
11121101
0 commit comments