-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
NorthwindDbFunctionsQueryCosmosTest.cs
90 lines (70 loc) · 2.44 KB
/
NorthwindDbFunctionsQueryCosmosTest.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
// 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;
#nullable disable
public class NorthwindDbFunctionsQueryCosmosTest : NorthwindDbFunctionsQueryTestBase<NorthwindQueryCosmosFixture<NoopModelCustomizer>>
{
public NorthwindDbFunctionsQueryCosmosTest(
NorthwindQueryCosmosFixture<NoopModelCustomizer> fixture,
ITestOutputHelper testOutputHelper)
: base(fixture)
{
ClearLog();
}
[ConditionalFact]
public virtual void Check_all_tests_overridden()
=> TestHelpers.AssertAllMethodsOverridden(GetType());
public override async Task Like_all_literals(bool async)
{
await AssertTranslationFailed(() => base.Like_all_literals(async));
AssertSql();
}
public override async Task Like_all_literals_with_escape(bool async)
{
await AssertTranslationFailed(() => base.Like_all_literals_with_escape(async));
AssertSql();
}
public override async Task Like_literal(bool async)
{
await AssertTranslationFailed(() => base.Like_literal(async));
AssertSql();
}
public override async Task Like_literal_with_escape(bool async)
{
await AssertTranslationFailed(() => base.Like_literal_with_escape(async));
AssertSql();
}
public override async Task Like_identity(bool async)
{
await AssertTranslationFailed(() => base.Like_identity(async));
AssertSql();
}
public override Task Random_return_less_than_1(bool async)
=> Fixture.NoSyncTest(
async, async a =>
{
await base.Random_return_less_than_1(async);
AssertSql(
"""
SELECT VALUE COUNT(1)
FROM root c
WHERE ((c["$type"] = "Order") AND (RAND() < 1.0))
""");
});
public override Task Random_return_greater_than_0(bool async)
=> Fixture.NoSyncTest(
async, async a =>
{
await base.Random_return_greater_than_0(async);
AssertSql(
"""
SELECT VALUE COUNT(1)
FROM root c
WHERE ((c["$type"] = "Order") AND (RAND() >= 0.0))
""");
});
private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);
protected void ClearLog()
=> Fixture.TestSqlLoggerFactory.Clear();
}