@@ -1078,35 +1078,24 @@ from c in db.Customers
1078
1078
}
1079
1079
1080
1080
[ 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 ( )
1084
1083
{
1085
- if ( useCrossJoin && ! Dialect . SupportsCrossJoin )
1086
- {
1087
- Assert . Ignore ( "Dialect does not support cross join." ) ;
1088
- }
1089
-
1090
1084
var q =
1091
1085
from c in db . Customers
1092
1086
join o in db . Orders on
1093
1087
new { c . CustomerId , HasContractTitle = c . ContactTitle != null } equals
1094
1088
new { o . Customer . CustomerId , HasContractTitle = o . Customer . ContactTitle != null }
1095
1089
select new { c . ContactName , o . OrderId } ;
1096
1090
1097
- using ( var substitute = SubstituteDialect ( ) )
1098
1091
using ( var sqlSpy = new SqlLogSpy ( ) )
1099
1092
{
1100
- ClearQueryPlanCache ( ) ;
1101
- substitute . Value . SupportsCrossJoin . Returns ( useCrossJoin ) ;
1102
-
1103
1093
await ( ObjectDumper . WriteAsync ( q ) ) ;
1104
1094
1105
1095
var sql = sqlSpy . GetWholeLog ( ) ;
1106
- Assert . That ( sql , Does . Contain ( useCrossJoin ? "cross join" : "inner join" ) ) ;
1107
1096
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 ) ) ;
1110
1099
}
1111
1100
}
1112
1101
0 commit comments