-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathNavigationsBulkUpdateNpgsqlTest.cs
More file actions
137 lines (97 loc) · 6.54 KB
/
NavigationsBulkUpdateNpgsqlTest.cs
File metadata and controls
137 lines (97 loc) · 6.54 KB
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit.Sdk;
namespace Microsoft.EntityFrameworkCore.Query.Associations.Navigations;
public class NavigationsBulkUpdateNpgsqlTest(NavigationsNpgsqlFixture fixture, ITestOutputHelper testOutputHelper)
: NavigationsBulkUpdateRelationalTestBase<NavigationsNpgsqlFixture>(fixture, testOutputHelper)
{
[ConditionalFact]
public virtual void Check_all_tests_overridden()
=> TestHelpers.AssertAllMethodsOverridden(GetType());
// FK constraint failures
public override Task Delete_entity_with_associations()
=> Assert.ThrowsAsync<PostgresException>(base.Delete_entity_with_associations);
public override Task Delete_required_associate()
=> Assert.ThrowsAsync<PostgresException>(base.Delete_required_associate);
public override Task Delete_optional_associate()
=> Assert.ThrowsAsync<PostgresException>(base.Delete_optional_associate);
// PostgreSQL generates valid SQL for these but produces wrong row counts due to self-joins in UPDATE ... FROM
public override Task Update_property_inside_associate()
=> Assert.ThrowsAsync<EqualException>(base.Update_property_inside_associate);
public override Task Update_property_inside_associate_with_special_chars()
=> Assert.ThrowsAsync<EqualException>(base.Update_property_inside_associate_with_special_chars);
public override Task Update_property_on_projected_associate()
=> Assert.ThrowsAsync<EqualException>(base.Update_property_on_projected_associate);
public override Task Update_property_on_projected_associate_with_OrderBy_Skip()
=> Assert.ThrowsAsync<EqualException>(base.Update_property_on_projected_associate_with_OrderBy_Skip);
public override Task Update_multiple_properties_inside_same_associate()
=> Assert.ThrowsAsync<EqualException>(base.Update_multiple_properties_inside_same_associate);
public override Task Update_primitive_collection_to_constant()
=> Assert.ThrowsAsync<EqualException>(base.Update_primitive_collection_to_constant);
public override Task Update_primitive_collection_to_parameter()
=> Assert.ThrowsAsync<EqualException>(base.Update_primitive_collection_to_parameter);
// Translation not yet supported for navigation-mapped associations
public override Task Update_associate_to_parameter()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_associate_to_parameter);
public override Task Update_associate_to_inline()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_associate_to_inline);
public override Task Update_associate_to_inline_with_lambda()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_associate_to_inline_with_lambda);
public override Task Update_associate_to_another_associate()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_associate_to_another_associate);
public override Task Update_associate_to_null()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_associate_to_null);
public override Task Update_associate_to_null_with_lambda()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_associate_to_null_with_lambda);
public override Task Update_associate_to_null_parameter()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_associate_to_null_parameter);
public override Task Update_nested_associate_to_parameter()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_nested_associate_to_parameter);
public override Task Update_nested_associate_to_inline_with_lambda()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_nested_associate_to_inline_with_lambda);
public override Task Update_nested_associate_to_another_nested_associate()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_nested_associate_to_another_nested_associate);
public override Task Update_nested_collection_to_parameter()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_nested_collection_to_parameter);
public override Task Update_nested_collection_to_inline_with_lambda()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_nested_collection_to_inline_with_lambda);
public override Task Update_nested_collection_to_another_nested_collection()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_nested_collection_to_another_nested_collection);
public override Task Update_collection_to_parameter()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_collection_to_parameter);
public override Task Update_collection_referencing_the_original_collection()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_collection_referencing_the_original_collection);
public override Task Update_primitive_collection_to_another_collection()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_primitive_collection_to_another_collection);
public override Task Update_inside_structural_collection()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_inside_structural_collection);
public override Task Update_multiple_properties_inside_associates_and_on_entity_type()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_multiple_properties_inside_associates_and_on_entity_type);
public override Task Update_multiple_projected_associates_via_anonymous_type()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_multiple_projected_associates_via_anonymous_type);
public override async Task Update_property_inside_nested_associate()
{
await base.Update_property_inside_nested_associate();
AssertExecuteUpdateSql(
"""
@p='foo_updated'
UPDATE "NestedAssociateType" AS n
SET "String" = @p
FROM "RootEntity" AS r
INNER JOIN "AssociateType" AS a ON r."RequiredAssociateId" = a."Id"
WHERE a."RequiredNestedAssociateId" = n."Id"
""");
}
public override async Task Update_associate_with_null_required_property()
{
await base.Update_associate_with_null_required_property();
AssertExecuteUpdateSql();
}
public override async Task Update_required_nested_associate_to_null()
{
await base.Update_required_nested_associate_to_null();
AssertExecuteUpdateSql();
}
public override Task Update_inside_primitive_collection()
=> Assert.ThrowsAsync<InvalidOperationException>(base.Update_inside_primitive_collection);
}