-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
NorthwindFunctionsQuerySqliteTest.cs
721 lines (551 loc) · 31.9 KB
/
NorthwindFunctionsQuerySqliteTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.EntityFrameworkCore.Query;
public class NorthwindFunctionsQuerySqliteTest : NorthwindFunctionsQueryRelationalTestBase<
NorthwindQuerySqliteFixture<NoopModelCustomizer>>
{
public NorthwindFunctionsQuerySqliteTest(
NorthwindQuerySqliteFixture<NoopModelCustomizer> fixture,
ITestOutputHelper testOutputHelper)
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}
public override Task Convert_ToBoolean(bool async)
=> AssertTranslationFailed(() => base.Convert_ToBoolean(async));
public override Task Convert_ToByte(bool async)
=> AssertTranslationFailed(() => base.Convert_ToByte(async));
public override Task Convert_ToDecimal(bool async)
=> AssertTranslationFailed(() => base.Convert_ToDecimal(async));
public override Task Convert_ToDouble(bool async)
=> AssertTranslationFailed(() => base.Convert_ToDouble(async));
public override Task Convert_ToInt16(bool async)
=> AssertTranslationFailed(() => base.Convert_ToInt16(async));
public override Task Convert_ToInt32(bool async)
=> AssertTranslationFailed(() => base.Convert_ToInt32(async));
public override Task Convert_ToInt64(bool async)
=> AssertTranslationFailed(() => base.Convert_ToInt64(async));
public override Task Convert_ToString(bool async)
=> AssertTranslationFailed(() => base.Convert_ToString(async));
public override Task Byte_Parse(bool async)
=> AssertTranslationFailed(() => base.Byte_Parse(async));
public override Task Decimal_Parse(bool async)
=> AssertTranslationFailed(() => base.Decimal_Parse(async));
public override Task Double_Parse(bool async)
=> AssertTranslationFailed(() => base.Double_Parse(async));
public override Task Short_Parse(bool async)
=> AssertTranslationFailed(() => base.Short_Parse(async));
public override Task Int_Parse(bool async)
=> AssertTranslationFailed(() => base.Int_Parse(async));
public override Task Long_Parse(bool async)
=> AssertTranslationFailed(() => base.Long_Parse(async));
public override Task Projecting_Math_Truncate_and_ordering_by_it_twice(bool async)
=> AssertTranslationFailed(() => base.Projecting_Math_Truncate_and_ordering_by_it_twice(async));
public override Task Projecting_Math_Truncate_and_ordering_by_it_twice2(bool async)
=> AssertTranslationFailed(() => base.Projecting_Math_Truncate_and_ordering_by_it_twice2(async));
public override Task Projecting_Math_Truncate_and_ordering_by_it_twice3(bool async)
=> AssertTranslationFailed(() => base.Projecting_Math_Truncate_and_ordering_by_it_twice3(async));
public override Task Where_functions_nested(bool async)
=> AssertTranslationFailed(() => base.Where_functions_nested(async));
public override Task Where_guid_newguid(bool async)
=> AssertTranslationFailed(() => base.Where_guid_newguid(async));
public override Task Where_math_abs3(bool async)
=> AssertTranslationFailed(() => base.Where_math_abs3(async));
public override Task Where_math_acos(bool async)
=> AssertTranslationFailed(() => base.Where_math_acos(async));
public override Task Where_math_asin(bool async)
=> AssertTranslationFailed(() => base.Where_math_asin(async));
public override Task Where_math_atan(bool async)
=> AssertTranslationFailed(() => base.Where_math_atan(async));
public override Task Where_math_atan2(bool async)
=> AssertTranslationFailed(() => base.Where_math_atan2(async));
public override Task Where_math_ceiling1(bool async)
=> AssertTranslationFailed(() => base.Where_math_ceiling1(async));
public override Task Where_math_ceiling2(bool async)
=> AssertTranslationFailed(() => base.Where_math_ceiling2(async));
public override Task Where_math_cos(bool async)
=> AssertTranslationFailed(() => base.Where_math_cos(async));
public override Task Where_math_exp(bool async)
=> AssertTranslationFailed(() => base.Where_math_exp(async));
public override Task Where_math_floor(bool async)
=> AssertTranslationFailed(() => base.Where_math_floor(async));
public override Task Where_math_log(bool async)
=> AssertTranslationFailed(() => base.Where_math_log(async));
public override Task Where_math_log_new_base(bool async)
=> AssertTranslationFailed(() => base.Where_math_log_new_base(async));
public override Task Where_math_log10(bool async)
=> AssertTranslationFailed(() => base.Where_math_log10(async));
public override Task Where_math_power(bool async)
=> AssertTranslationFailed(() => base.Where_math_power(async));
public override Task Where_math_square(bool async)
=> AssertTranslationFailed(() => base.Where_math_square(async));
public override Task Where_math_round(bool async)
=> AssertTranslationFailed(() => base.Where_math_round(async));
public override Task Sum_over_round_works_correctly_in_projection(bool async)
=> AssertTranslationFailed(() => base.Sum_over_round_works_correctly_in_projection(async));
public override Task Sum_over_round_works_correctly_in_projection_2(bool async)
=> AssertTranslationFailed(() => base.Sum_over_round_works_correctly_in_projection_2(async));
public override Task Sum_over_truncate_works_correctly_in_projection(bool async)
=> AssertTranslationFailed(() => base.Sum_over_truncate_works_correctly_in_projection(async));
public override Task Sum_over_truncate_works_correctly_in_projection_2(bool async)
=> AssertTranslationFailed(() => base.Sum_over_truncate_works_correctly_in_projection_2(async));
public override Task Where_math_round2(bool async)
=> AssertTranslationFailed(() => base.Where_math_round2(async));
public override Task Where_math_sign(bool async)
=> AssertTranslationFailed(() => base.Where_math_sign(async));
public override Task Where_math_sin(bool async)
=> AssertTranslationFailed(() => base.Where_math_sin(async));
public override Task Where_math_sqrt(bool async)
=> AssertTranslationFailed(() => base.Where_math_sqrt(async));
public override Task Where_math_tan(bool async)
=> AssertTranslationFailed(() => base.Where_math_tan(async));
public override Task Where_math_truncate(bool async)
=> AssertTranslationFailed(() => base.Where_math_truncate(async));
public override Task Where_mathf_acos(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_acos(async));
public override Task Where_mathf_asin(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_asin(async));
public override Task Where_mathf_atan(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_atan(async));
public override Task Where_mathf_atan2(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_atan2(async));
public override Task Where_mathf_ceiling1(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_ceiling1(async));
public override Task Where_mathf_cos(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_cos(async));
public override Task Where_mathf_exp(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_exp(async));
public override Task Where_mathf_floor(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_floor(async));
public override Task Where_mathf_log(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_log(async));
public override Task Where_mathf_log_new_base(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_log_new_base(async));
public override Task Where_mathf_log10(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_log10(async));
public override Task Where_mathf_power(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_power(async));
public override Task Where_mathf_square(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_square(async));
public override Task Where_mathf_sign(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_sign(async));
public override Task Where_mathf_sin(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_sin(async));
public override Task Where_mathf_sqrt(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_sqrt(async));
public override Task Where_mathf_tan(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_tan(async));
public override Task Where_mathf_truncate(bool async)
=> AssertTranslationFailed(() => base.Where_mathf_truncate(async));
public override async Task String_StartsWith_Literal(bool async)
{
await base.String_StartsWith_Literal(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" IS NOT NULL AND (""c"".""ContactName"" LIKE 'M%')");
}
public override async Task String_StartsWith_Identity(bool async)
{
await base.String_StartsWith_Identity(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" = '' OR (""c"".""ContactName"" IS NOT NULL AND (((""c"".""ContactName"" LIKE ""c"".""ContactName"" || '%') AND substr(""c"".""ContactName"", 1, length(""c"".""ContactName"")) = ""c"".""ContactName"") OR ""c"".""ContactName"" = ''))");
}
public override async Task String_StartsWith_Column(bool async)
{
await base.String_StartsWith_Column(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" = '' OR (""c"".""ContactName"" IS NOT NULL AND (((""c"".""ContactName"" LIKE ""c"".""ContactName"" || '%') AND substr(""c"".""ContactName"", 1, length(""c"".""ContactName"")) = ""c"".""ContactName"") OR ""c"".""ContactName"" = ''))");
}
public override async Task String_StartsWith_MethodCall(bool async)
{
await base.String_StartsWith_MethodCall(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" IS NOT NULL AND (""c"".""ContactName"" LIKE 'M%')");
}
public override async Task String_EndsWith_Literal(bool async)
{
await base.String_EndsWith_Literal(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" IS NOT NULL AND (""c"".""ContactName"" LIKE '%b')");
}
public override async Task String_EndsWith_Identity(bool async)
{
await base.String_EndsWith_Identity(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" = '' OR (""c"".""ContactName"" IS NOT NULL AND (substr(""c"".""ContactName"", -length(""c"".""ContactName"")) = ""c"".""ContactName"" OR ""c"".""ContactName"" = ''))");
}
public override async Task String_EndsWith_Column(bool async)
{
await base.String_EndsWith_Column(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" = '' OR (""c"".""ContactName"" IS NOT NULL AND (substr(""c"".""ContactName"", -length(""c"".""ContactName"")) = ""c"".""ContactName"" OR ""c"".""ContactName"" = ''))");
}
public override async Task String_EndsWith_MethodCall(bool async)
{
await base.String_EndsWith_MethodCall(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" IS NOT NULL AND (""c"".""ContactName"" LIKE '%m')");
}
public override async Task String_Contains_Literal(bool async)
{
await base.String_Contains_Literal(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE 'M' = '' OR instr(""c"".""ContactName"", 'M') > 0");
}
public override async Task String_Contains_Identity(bool async)
{
await base.String_Contains_Identity(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" = '' OR instr(""c"".""ContactName"", ""c"".""ContactName"") > 0");
}
public override async Task String_Contains_Column(bool async)
{
await base.String_Contains_Column(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""ContactName"" = '' OR instr(""c"".""ContactName"", ""c"".""ContactName"") > 0");
}
public override async Task String_FirstOrDefault_MethodCall(bool async)
{
await base.String_FirstOrDefault_MethodCall(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE substr(""c"".""ContactName"", 1, 1) = 'A'");
}
public override async Task String_LastOrDefault_MethodCall(bool async)
{
await base.String_LastOrDefault_MethodCall(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE substr(""c"".""ContactName"", length(""c"".""ContactName""), 1) = 's'");
}
public override async Task String_Contains_MethodCall(bool async)
{
await base.String_Contains_MethodCall(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE 'M' = '' OR instr(""c"".""ContactName"", 'M') > 0");
}
public override async Task IsNullOrWhiteSpace_in_predicate(bool async)
{
await base.IsNullOrWhiteSpace_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""Region"" IS NULL OR trim(""c"".""Region"") = ''");
}
public override async Task Indexof_with_emptystring(bool async)
{
await base.Indexof_with_emptystring(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE (instr(""c"".""ContactName"", '') - 1) = 0");
}
public override async Task Indexof_with_one_constant_arg(bool async)
{
await base.Indexof_with_one_constant_arg(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE (instr(""c"".""ContactName"", 'a') - 1) = 1");
}
public override async Task Indexof_with_one_parameter_arg(bool async)
{
await base.Indexof_with_one_parameter_arg(async);
AssertSql(
@"@__pattern_0='a' (Size = 1)
SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE (instr(""c"".""ContactName"", @__pattern_0) - 1) = 1");
}
public override Task Indexof_with_constant_starting_position(bool async)
=> AssertTranslationFailed(() => base.Indexof_with_constant_starting_position(async));
public override Task Indexof_with_parameter_starting_position(bool async)
=> AssertTranslationFailed(() => base.Indexof_with_parameter_starting_position(async));
public override async Task Replace_with_emptystring(bool async)
{
await base.Replace_with_emptystring(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE replace(""c"".""ContactName"", 'ia', '') = 'Mar Anders'");
}
public override async Task Replace_using_property_arguments(bool async)
{
await base.Replace_using_property_arguments(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE replace(""c"".""ContactName"", ""c"".""ContactName"", ""c"".""CustomerID"") = ""c"".""CustomerID""");
}
public override async Task Substring_with_one_arg_with_zero_startindex(bool async)
{
await base.Substring_with_one_arg_with_zero_startindex(async);
AssertSql(
@"SELECT ""c"".""ContactName""
FROM ""Customers"" AS ""c""
WHERE substr(""c"".""CustomerID"", 0 + 1) = 'ALFKI'");
}
public override async Task Substring_with_one_arg_with_constant(bool async)
{
await base.Substring_with_one_arg_with_constant(async);
AssertSql(
@"SELECT ""c"".""ContactName""
FROM ""Customers"" AS ""c""
WHERE substr(""c"".""CustomerID"", 1 + 1) = 'LFKI'");
}
public override async Task Substring_with_one_arg_with_closure(bool async)
{
await base.Substring_with_one_arg_with_closure(async);
AssertSql(
@"@__start_0='2'
SELECT ""c"".""ContactName""
FROM ""Customers"" AS ""c""
WHERE substr(""c"".""CustomerID"", @__start_0 + 1) = 'FKI'");
}
public override async Task Substring_with_two_args_with_zero_startindex(bool async)
{
await base.Substring_with_two_args_with_zero_startindex(async);
AssertSql(
@"SELECT substr(""c"".""ContactName"", 0 + 1, 3)
FROM ""Customers"" AS ""c""
WHERE ""c"".""CustomerID"" = 'ALFKI'");
}
public override async Task Substring_with_two_args_with_constant(bool async)
{
await base.Substring_with_two_args_with_constant(async);
AssertSql(
@"SELECT substr(""c"".""ContactName"", 1 + 1, 3)
FROM ""Customers"" AS ""c""
WHERE ""c"".""CustomerID"" = 'ALFKI'");
}
public override async Task Substring_with_two_args_with_closure(bool async)
{
await base.Substring_with_two_args_with_closure(async);
AssertSql(
@"@__start_0='2'
SELECT substr(""c"".""ContactName"", @__start_0 + 1, 3)
FROM ""Customers"" AS ""c""
WHERE ""c"".""CustomerID"" = 'ALFKI'");
}
public override async Task Substring_with_two_args_with_Index_of(bool async)
{
await base.Substring_with_two_args_with_Index_of(async);
AssertSql(
@"SELECT substr(""c"".""ContactName"", (instr(""c"".""ContactName"", 'a') - 1) + 1, 3)
FROM ""Customers"" AS ""c""
WHERE ""c"".""CustomerID"" = 'ALFKI'");
}
public override async Task Substring_with_two_args_with_zero_length(bool async)
{
await base.Substring_with_two_args_with_zero_length(async);
AssertSql(
@"SELECT substr(""c"".""ContactName"", 2 + 1, 0)
FROM ""Customers"" AS ""c""
WHERE ""c"".""CustomerID"" = 'ALFKI'");
}
public override async Task Where_math_abs1(bool async)
{
await base.Where_math_abs1(async);
AssertSql(
@"SELECT ""p"".""ProductID"", ""p"".""Discontinued"", ""p"".""ProductName"", ""p"".""SupplierID"", ""p"".""UnitPrice"", ""p"".""UnitsInStock""
FROM ""Products"" AS ""p""
WHERE abs(""p"".""ProductID"") > 10");
}
public override async Task Where_math_abs2(bool async)
{
await base.Where_math_abs2(async);
AssertSql(
@"SELECT ""o"".""OrderID"", ""o"".""ProductID"", ""o"".""Discount"", ""o"".""Quantity"", ""o"".""UnitPrice""
FROM ""Order Details"" AS ""o""
WHERE ""o"".""UnitPrice"" < 7.0 AND abs(""o"".""Quantity"") > 10");
}
public override async Task Where_math_abs_uncorrelated(bool async)
{
await base.Where_math_abs_uncorrelated(async);
AssertSql(
@"SELECT ""o"".""OrderID"", ""o"".""ProductID"", ""o"".""Discount"", ""o"".""Quantity"", ""o"".""UnitPrice""
FROM ""Order Details"" AS ""o""
WHERE ""o"".""UnitPrice"" < 7.0 AND 10 < ""o"".""ProductID""");
}
public override async Task Select_math_round_int(bool async)
{
await base.Select_math_round_int(async);
AssertSql(
@"SELECT round(CAST(""o"".""OrderID"" AS REAL)) AS ""A""
FROM ""Orders"" AS ""o""
WHERE ""o"".""OrderID"" < 10250");
}
public override async Task Where_math_min(bool async)
{
await base.Where_math_min(async);
AssertSql(
@"SELECT ""o"".""OrderID"", ""o"".""ProductID"", ""o"".""Discount"", ""o"".""Quantity"", ""o"".""UnitPrice""
FROM ""Order Details"" AS ""o""
WHERE ""o"".""OrderID"" = 11077 AND min(""o"".""OrderID"", ""o"".""ProductID"") = ""o"".""ProductID""");
}
public override async Task Where_math_max(bool async)
{
await base.Where_math_max(async);
AssertSql(
@"SELECT ""o"".""OrderID"", ""o"".""ProductID"", ""o"".""Discount"", ""o"".""Quantity"", ""o"".""UnitPrice""
FROM ""Order Details"" AS ""o""
WHERE ""o"".""OrderID"" = 11077 AND max(""o"".""OrderID"", ""o"".""ProductID"") = ""o"".""OrderID""");
}
public override async Task Where_string_to_lower(bool async)
{
await base.Where_string_to_lower(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE lower(""c"".""CustomerID"") = 'alfki'");
}
public override async Task Where_string_to_upper(bool async)
{
await base.Where_string_to_upper(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE upper(""c"".""CustomerID"") = 'ALFKI'");
}
public override async Task TrimStart_without_arguments_in_predicate(bool async)
{
await base.TrimStart_without_arguments_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ltrim(""c"".""ContactTitle"") = 'Owner'");
}
public override async Task TrimStart_with_char_argument_in_predicate(bool async)
{
await base.TrimStart_with_char_argument_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ltrim(""c"".""ContactTitle"", 'O') = 'wner'");
}
public override async Task TrimStart_with_char_array_argument_in_predicate(bool async)
{
await base.TrimStart_with_char_array_argument_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ltrim(""c"".""ContactTitle"", 'Ow') = 'ner'");
}
public override async Task TrimEnd_without_arguments_in_predicate(bool async)
{
await base.TrimEnd_without_arguments_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE rtrim(""c"".""ContactTitle"") = 'Owner'");
}
public override async Task TrimEnd_with_char_argument_in_predicate(bool async)
{
await base.TrimEnd_with_char_argument_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE rtrim(""c"".""ContactTitle"", 'r') = 'Owne'");
}
public override async Task TrimEnd_with_char_array_argument_in_predicate(bool async)
{
await base.TrimEnd_with_char_array_argument_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE rtrim(""c"".""ContactTitle"", 'er') = 'Own'");
}
public override async Task Trim_without_argument_in_predicate(bool async)
{
await base.Trim_without_argument_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE trim(""c"".""ContactTitle"") = 'Owner'");
}
public override async Task Trim_with_char_argument_in_predicate(bool async)
{
await base.Trim_with_char_argument_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE trim(""c"".""ContactTitle"", 'O') = 'wner'");
}
public override async Task Trim_with_char_array_argument_in_predicate(bool async)
{
await base.Trim_with_char_array_argument_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE trim(""c"".""ContactTitle"", 'Or') = 'wne'");
}
public override async Task Regex_IsMatch_MethodCall(bool async)
{
await base.Regex_IsMatch_MethodCall(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE regexp('^T', ""c"".""CustomerID"")");
}
public override async Task Regex_IsMatch_MethodCall_constant_input(bool async)
{
await base.Regex_IsMatch_MethodCall_constant_input(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE regexp(""c"".""CustomerID"", 'ALFKI')");
}
public override async Task IsNullOrEmpty_in_predicate(bool async)
{
await base.IsNullOrEmpty_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""Region"" IS NULL OR ""c"".""Region"" = ''");
}
public override async Task IsNullOrEmpty_in_projection(bool async)
{
await base.IsNullOrEmpty_in_projection(async);
AssertSql(
@"SELECT ""c"".""CustomerID"" AS ""Id"", ""c"".""Region"" IS NULL OR ""c"".""Region"" = '' AS ""Value""
FROM ""Customers"" AS ""c""");
}
public override async Task IsNullOrEmpty_negated_in_predicate(bool async)
{
await base.IsNullOrEmpty_negated_in_predicate(async);
AssertSql(
@"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region""
FROM ""Customers"" AS ""c""
WHERE ""c"".""Region"" IS NOT NULL AND ""c"".""Region"" <> ''");
}
public override Task Datetime_subtraction_TotalDays(bool async)
=> AssertTranslationFailed(() => base.Datetime_subtraction_TotalDays(async));
private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);
}