@@ -295,8 +295,8 @@ public void ProjectAsWrapper_Collection_TopOnNullExpand()
295295 // Arrange
296296 _settings . HandleNullPropagation = HandleNullPropagationOption . True ;
297297
298- IEdmEntityType vipCustomer = _model . SchemaElements . OfType < IEdmEntityType > ( ) . First ( c => c . Name == " QueryVipCustomer" ) ;
299- IEdmNavigationProperty specialOrdersNav = vipCustomer . DeclaredNavigationProperties ( ) . Single ( c => c . Name == " SpecialOrders" ) ;
298+ IEdmEntityType vipCustomer = _model . SchemaElements . OfType < IEdmEntityType > ( ) . First ( c => c . Name == nameof ( QueryVipCustomer ) ) ;
299+ IEdmNavigationProperty specialOrdersNav = vipCustomer . DeclaredNavigationProperties ( ) . Single ( c => c . Name == nameof ( QueryVipCustomer . SpecialOrders ) ) ;
300300 ExpandedNavigationSelectItem expandItem = new ExpandedNavigationSelectItem (
301301 new ODataExpandPath ( new NavigationPropertySegment ( specialOrdersNav , navigationSource : _orders ) ) ,
302302 _orders ,
@@ -317,8 +317,12 @@ public void ProjectAsWrapper_Collection_TopOnNullExpand()
317317 Expression projection = _binder . ProjectAsWrapper ( source , selectExpand , vipCustomer , _customers ) ;
318318
319319 // Assert
320- IEnumerable < SelectExpandWrapper < QueryOrder > > projectedOrders = Expression . Lambda ( projection ) . Compile ( ) . DynamicInvoke ( ) as IEnumerable < SelectExpandWrapper < QueryOrder > > ;
321- Assert . Null ( projectedOrders ) ;
320+ object rawProjectionResult = Expression . Lambda ( projection ) . Compile ( ) . DynamicInvoke ( ) ;
321+ Assert . NotNull ( rawProjectionResult ) ;
322+ SelectExpandWrapper < QueryVipCustomer > projectedCustomer = rawProjectionResult as SelectExpandWrapper < QueryVipCustomer > ;
323+ Assert . NotNull ( projectedCustomer ) ;
324+ Assert . True ( projectedCustomer . TryGetPropertyValue ( nameof ( QueryVipCustomer . SpecialOrders ) , out object rawSpecialOrders ) ) ;
325+ Assert . Null ( rawSpecialOrders ) ;
322326 }
323327
324328 [ Fact ]
0 commit comments