File tree Expand file tree Collapse file tree
test/System.Linq.Dynamic.Core.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System . Collections . Generic ;
2+ using System . Linq . Dynamic . Core . Exceptions ;
23using System . Linq . Dynamic . Core . Tests . Helpers . Models ;
4+ using NFluent ;
35using Xunit ;
46
57namespace System . Linq . Dynamic . Core . Tests
@@ -152,5 +154,21 @@ public void GroupJoinOnNullableType_LeftNullable()
152154 }
153155 }
154156 }
157+
158+ [ Fact ]
159+ public void GroupJoinOnNullableType_NotSameTypesThrowsException ( )
160+ {
161+ var person = new Person { Id = 1 , Name = "Hedlund, Magnus" } ;
162+ var people = new List < Person > { person } ;
163+ var pets = new List < Pet > { new Pet { Name = "Daisy" , OwnerId = person . Id } } ;
164+
165+ Check . ThatCode ( ( ) =>
166+ people . AsQueryable ( )
167+ . GroupJoin (
168+ pets ,
169+ "it.Id" ,
170+ "Name" , // This is wrong
171+ "new(outer.Name as OwnerName, inner as Pets)" ) ) . Throws < ParseException > ( ) ;
172+ }
155173 }
156174}
You can’t perform that action at this time.
0 commit comments