1- using System . Text ;
1+ using EfCore . Ydb . FunctionalTests . TestUtilities ;
22using Microsoft . EntityFrameworkCore . BulkUpdates ;
3- using Xunit ;
43using Xunit . Abstractions ;
5- using Xunit . Sdk ;
64
75namespace EfCore . Ydb . FunctionalTests . AllTests . BulkUpdates ;
86
@@ -16,158 +14,131 @@ ITestOutputHelper testOutputHelper
1614 TPHFiltersInheritanceBulkUpdatesYdbFixture > ( fixture , testOutputHelper )
1715{
1816 public override Task Delete_where_keyless_entity_mapped_to_sql_query ( bool async )
19- => TestIgnoringBase (
17+ => SharedTestMethods . TestIgnoringBase (
2018 base . Delete_where_keyless_entity_mapped_to_sql_query ,
19+ Fixture . TestSqlLoggerFactory ,
2120 async
2221 ) ;
2322
2423 public override Task Update_where_keyless_entity_mapped_to_sql_query ( bool async )
25- => TestIgnoringBase (
24+ => SharedTestMethods . TestIgnoringBase (
2625 base . Update_where_keyless_entity_mapped_to_sql_query ,
26+ Fixture . TestSqlLoggerFactory ,
2727 async
2828 ) ;
2929
3030 public override Task Delete_where_hierarchy ( bool async )
31- => TestIgnoringBase (
31+ => SharedTestMethods . TestIgnoringBase (
3232 base . Delete_where_hierarchy ,
33+ Fixture . TestSqlLoggerFactory ,
3334 async
3435 ) ;
3536
3637 public override Task Delete_where_hierarchy_subquery ( bool async )
37- => TestIgnoringBase (
38+ => SharedTestMethods . TestIgnoringBase (
3839 base . Delete_where_hierarchy_subquery ,
40+ Fixture . TestSqlLoggerFactory ,
3941 async
4042 ) ;
4143
4244 public override Task Delete_where_hierarchy_derived ( bool async )
43- => TestIgnoringBase (
45+ => SharedTestMethods . TestIgnoringBase (
4446 base . Delete_where_hierarchy_derived ,
47+ Fixture . TestSqlLoggerFactory ,
4548 async
4649 ) ;
4750
4851 public override Task Delete_where_using_hierarchy ( bool async )
49- => TestIgnoringBase (
52+ => SharedTestMethods . TestIgnoringBase (
5053 base . Delete_where_using_hierarchy ,
54+ Fixture . TestSqlLoggerFactory ,
5155 async
5256 ) ;
5357
5458 public override Task Delete_where_using_hierarchy_derived ( bool async )
55- => TestIgnoringBase (
59+ => SharedTestMethods . TestIgnoringBase (
5660 base . Delete_where_using_hierarchy_derived ,
61+ Fixture . TestSqlLoggerFactory ,
5762 async
5863 ) ;
5964
6065 public override Task Delete_GroupBy_Where_Select_First ( bool async )
61- => TestIgnoringBase (
66+ => SharedTestMethods . TestIgnoringBase (
6267 base . Delete_GroupBy_Where_Select_First ,
68+ Fixture . TestSqlLoggerFactory ,
6369 async
6470 ) ;
6571
6672 public override Task Delete_GroupBy_Where_Select_First_2 ( bool async )
67- => TestIgnoringBase (
73+ => SharedTestMethods . TestIgnoringBase (
6874 base . Delete_GroupBy_Where_Select_First_2 ,
75+ Fixture . TestSqlLoggerFactory ,
6976 async
7077 ) ;
7178
7279 public override Task Delete_GroupBy_Where_Select_First_3 ( bool async )
73- => TestIgnoringBase (
80+ => SharedTestMethods . TestIgnoringBase (
7481 base . Delete_GroupBy_Where_Select_First_3 ,
82+ Fixture . TestSqlLoggerFactory ,
7583 async
7684 ) ;
7785
7886 public override Task Update_base_type ( bool async )
79- => TestIgnoringBase (
87+ => SharedTestMethods . TestIgnoringBase (
8088 base . Update_base_type ,
89+ Fixture . TestSqlLoggerFactory ,
8190 async
8291 ) ;
8392
8493 public override Task Update_base_type_with_OfType ( bool async )
85- => TestIgnoringBase (
94+ => SharedTestMethods . TestIgnoringBase (
8695 base . Update_base_type_with_OfType ,
96+ Fixture . TestSqlLoggerFactory ,
8797 async
8898 ) ;
8999
90100 public override Task Update_where_hierarchy_subquery ( bool async )
91- => TestIgnoringBase (
101+ => SharedTestMethods . TestIgnoringBase (
92102 base . Update_where_hierarchy_subquery ,
103+ Fixture . TestSqlLoggerFactory ,
93104 async
94105 ) ;
95106
96107 public override Task Update_base_property_on_derived_type ( bool async )
97- => TestIgnoringBase (
108+ => SharedTestMethods . TestIgnoringBase (
98109 base . Update_base_property_on_derived_type ,
110+ Fixture . TestSqlLoggerFactory ,
99111 async
100112 ) ;
101113
102114 public override Task Update_derived_property_on_derived_type ( bool async )
103- => TestIgnoringBase (
115+ => SharedTestMethods . TestIgnoringBase (
104116 base . Update_derived_property_on_derived_type ,
117+ Fixture . TestSqlLoggerFactory ,
105118 async
106119 ) ;
107120
108121 public override Task Update_base_and_derived_types ( bool async )
109- => TestIgnoringBase (
122+ => SharedTestMethods . TestIgnoringBase (
110123 base . Update_base_and_derived_types ,
124+ Fixture . TestSqlLoggerFactory ,
111125 async
112126 ) ;
113127
114128 public override Task Update_where_using_hierarchy ( bool async )
115- => TestIgnoringBase (
129+ => SharedTestMethods . TestIgnoringBase (
116130 base . Update_where_using_hierarchy ,
131+ Fixture . TestSqlLoggerFactory ,
117132 async
118133 ) ;
119134
120135 public override Task Update_where_using_hierarchy_derived ( bool async )
121- => TestIgnoringBase (
136+ => SharedTestMethods . TestIgnoringBase (
122137 base . Update_where_using_hierarchy_derived ,
138+ Fixture . TestSqlLoggerFactory ,
123139 async
124140 ) ;
125141
126142 protected override void ClearLog ( )
127143 => Fixture . TestSqlLoggerFactory . Clear ( ) ;
128-
129- private async Task TestIgnoringBase (
130- Func < bool , Task > baseTest ,
131- bool async ,
132- params string [ ] expectedSql
133- )
134- {
135- try
136- {
137- await baseTest ( async ) ;
138- }
139- catch ( EqualException ex )
140- {
141- var commands = Fixture . TestSqlLoggerFactory . SqlStatements ;
142- var commandsStr = new StringBuilder ( ) ;
143-
144- foreach ( var command in commands )
145- {
146- commandsStr . Append ( "\n >>>\n " ) ;
147- commandsStr . Append ( command ) ;
148- }
149-
150-
151- if ( expectedSql . Length == 0 ) throw new AggregateException ( ex , new Exception ( commandsStr . ToString ( ) ) ) ;
152- var actual = Fixture . TestSqlLoggerFactory . SqlStatements ;
153- for ( var i = 0 ; i < expectedSql . Length ; i ++ )
154- {
155- Assert . Equal ( expectedSql [ i ] , actual [ i ] ) ;
156- }
157- }
158- catch ( Exception ex )
159- {
160- var commands = Fixture . TestSqlLoggerFactory . SqlStatements ;
161- var commandsStr = new StringBuilder ( ) ;
162-
163- foreach ( var command in commands )
164- {
165- commandsStr . Append ( "\n >>>\n " ) ;
166- commandsStr . Append ( command ) ;
167- }
168-
169-
170- throw new AggregateException ( new Exception ( $ "Sql:{ commandsStr } \n <<<\n ") , ex ) ;
171- }
172- }
173144}
0 commit comments