@@ -76,6 +76,25 @@ public void Can_select_partial_list_of_fields()
76
76
}
77
77
}
78
78
79
+ [ Test ]
80
+ public void Can_select_partial_list_of_fields_case_insensitive ( )
81
+ {
82
+ using ( var db = OpenDbConnection ( ) )
83
+ {
84
+ db . DropAndCreateTable < Person > ( ) ;
85
+ db . InsertAll ( Person . Rockstars ) ;
86
+
87
+ var results = db . Select ( db . From < Person > ( ) . Select ( new [ ] { "id" , "firstname" , "age" } ) ) ;
88
+
89
+ db . GetLastSql ( ) . Print ( ) ;
90
+
91
+ Assert . That ( results . All ( x => x . Id > 0 ) ) ;
92
+ Assert . That ( results . All ( x => x . FirstName != null ) ) ;
93
+ Assert . That ( results . All ( x => x . LastName == null ) ) ;
94
+ Assert . That ( results . Any ( x => x . Age > 0 ) ) ;
95
+ }
96
+ }
97
+
79
98
[ Test ]
80
99
public void Does_ignore_invalid_fields ( )
81
100
{
@@ -106,7 +125,7 @@ public void Can_select_fields_from_joined_table()
106
125
db . InsertAll ( RockstarAlbum . SeedAlbums ) ;
107
126
108
127
var q = db . From < Person > ( )
109
- . Join < RockstarAlbum > ( ( p , a ) => p . Id == a . RockstarId )
128
+ . Join < RockstarAlbum > ( ( p , a ) => p . Id == a . RockstarId )
110
129
. Select ( new [ ] { "Id" , "FirstName" , "Age" , "RockstarAlbumName" } ) ;
111
130
112
131
var results = db . Select < PersonWithAlbum > ( q ) ;
@@ -121,5 +140,32 @@ public void Can_select_fields_from_joined_table()
121
140
Assert . That ( results . All ( x => x . RockstarAlbumName != null ) ) ;
122
141
}
123
142
}
143
+
144
+ [ Test ]
145
+ public void Can_select_fields_from_joined_table_case_insensitive ( )
146
+ {
147
+ using ( var db = OpenDbConnection ( ) )
148
+ {
149
+ db . DropAndCreateTable < Person > ( ) ;
150
+ db . InsertAll ( Person . Rockstars ) ;
151
+ db . DropAndCreateTable < RockstarAlbum > ( ) ;
152
+ db . InsertAll ( RockstarAlbum . SeedAlbums ) ;
153
+
154
+ var q = db . From < Person > ( )
155
+ . Join < RockstarAlbum > ( ( p , a ) => p . Id == a . RockstarId )
156
+ . Select ( new [ ] { "id" , "firstname" , "age" , "rockstaralbumname" } ) ;
157
+
158
+ var results = db . Select < PersonWithAlbum > ( q ) ;
159
+
160
+ db . GetLastSql ( ) . Print ( ) ;
161
+
162
+ Assert . That ( results . All ( x => x . Id > 0 ) ) ;
163
+ Assert . That ( results . All ( x => x . FirstName != null ) ) ;
164
+ Assert . That ( results . All ( x => x . LastName == null ) ) ;
165
+ Assert . That ( results . All ( x => x . Age > 0 ) ) ;
166
+ Assert . That ( results . All ( x => x . RockstarId == 0 ) ) ;
167
+ Assert . That ( results . All ( x => x . RockstarAlbumName != null ) ) ;
168
+ }
169
+ }
124
170
}
125
171
}
0 commit comments