|
15 | 15 |
|
16 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) |
17 | 17 |
|
18 | | -using System; |
19 | 18 | using System.Threading.Tasks; |
| 19 | +using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers; |
| 20 | +using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.TestUtilities; |
| 21 | +using FirebirdSql.EntityFrameworkCore.Firebird.Scaffolding.Internal; |
20 | 22 | using Microsoft.EntityFrameworkCore; |
| 23 | +using Microsoft.EntityFrameworkCore.Scaffolding; |
| 24 | +using Microsoft.EntityFrameworkCore.TestUtilities; |
| 25 | +using Microsoft.Extensions.DependencyInjection; |
21 | 26 | using Xunit; |
22 | 27 |
|
23 | 28 | namespace FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests |
24 | 29 | { |
25 | | - public class MigrationsFbTest : MigrationsTestBase<MigrationsFbFixture> |
| 30 | + public class MigrationsFbTest : MigrationsTestBase<MigrationsFbTest.MigrationsFbFixture> |
26 | 31 | { |
| 32 | + const string SkipReason = "Assumptions in model differ too much between base tests and Firebird."; |
| 33 | + |
27 | 34 | public MigrationsFbTest(MigrationsFbFixture fixture) |
28 | 35 | : base(fixture) |
29 | 36 | { } |
30 | 37 |
|
31 | | - protected override void GiveMeSomeTime(DbContext db) |
32 | | - { } |
| 38 | + protected override string NonDefaultCollation => "WIN1250"; |
33 | 39 |
|
34 | | - protected override Task GiveMeSomeTimeAsync(DbContext db) |
35 | | - => Task.CompletedTask; |
| 40 | + [Fact(Skip = SkipReason)] |
| 41 | + public override Task Create_table() => base.Create_table(); |
36 | 42 |
|
37 | | - [Fact] |
38 | | - public override void Can_generate_idempotent_up_scripts() |
39 | | - { |
40 | | - Assert.Throws<NotSupportedException>(base.Can_generate_idempotent_up_scripts); |
41 | | - } |
| 43 | + [Fact(Skip = SkipReason)] |
| 44 | + public override Task Create_table_all_settings() => base.Create_table_all_settings(); |
42 | 45 |
|
43 | | - [Fact] |
44 | | - public override void Can_generate_idempotent_down_scripts() |
45 | | - { |
46 | | - Assert.Throws<NotSupportedException>(base.Can_generate_idempotent_down_scripts); |
47 | | - } |
| 46 | + [Fact(Skip = SkipReason)] |
| 47 | + public override Task Create_table_no_key() => base.Create_table_no_key(); |
48 | 48 |
|
49 | | - [Fact(Skip = "")] |
50 | | - public override void Can_diff_against_2_2_model() |
51 | | - { } |
| 49 | + [Fact(Skip = SkipReason)] |
| 50 | + public override Task Create_table_with_comments() => base.Create_table_with_comments(); |
52 | 51 |
|
53 | | - [Fact(Skip = "")] |
54 | | - public override void Can_diff_against_3_0_ASP_NET_Identity_model() |
55 | | - { } |
| 52 | + [Fact(Skip = SkipReason)] |
| 53 | + public override Task Create_table_with_multiline_comments() => base.Create_table_with_multiline_comments(); |
56 | 54 |
|
57 | | - [Fact(Skip = "")] |
58 | | - public override void Can_diff_against_2_2_ASP_NET_Identity_model() |
59 | | - { } |
| 55 | + [Theory(Skip = SkipReason)] |
| 56 | + [InlineData(true)] |
| 57 | + [InlineData(false)] |
| 58 | + [InlineData(null)] |
| 59 | + public override Task Create_table_with_computed_column(bool? stored) => base.Create_table_with_computed_column(stored); |
60 | 60 |
|
61 | | - [Fact(Skip = "")] |
62 | | - public override void Can_diff_against_2_1_ASP_NET_Identity_model() |
63 | | - { } |
| 61 | + [Fact(Skip = SkipReason)] |
| 62 | + public override Task Alter_table_add_comment() => base.Alter_table_add_comment(); |
| 63 | + |
| 64 | + [Fact(Skip = SkipReason)] |
| 65 | + public override Task Alter_table_add_comment_non_default_schema() => base.Alter_table_add_comment_non_default_schema(); |
| 66 | + |
| 67 | + [Fact(Skip = SkipReason)] |
| 68 | + public override Task Alter_table_change_comment() => base.Alter_table_change_comment(); |
| 69 | + |
| 70 | + [Fact(Skip = SkipReason)] |
| 71 | + public override Task Alter_table_remove_comment() => base.Alter_table_remove_comment(); |
| 72 | + |
| 73 | + [Fact(Skip = SkipReason)] |
| 74 | + public override Task Drop_table() => base.Drop_table(); |
| 75 | + |
| 76 | + [Fact(Skip = SkipReason)] |
| 77 | + public override Task Rename_table() => base.Rename_table(); |
| 78 | + |
| 79 | + [Fact(Skip = SkipReason)] |
| 80 | + public override Task Rename_table_with_primary_key() => base.Rename_table_with_primary_key(); |
| 81 | + |
| 82 | + [Fact(Skip = SkipReason)] |
| 83 | + public override Task Move_table() => base.Move_table(); |
| 84 | + |
| 85 | + [Fact(Skip = SkipReason)] |
| 86 | + public override Task Create_schema() => base.Create_schema(); |
| 87 | + |
| 88 | + [Fact(Skip = SkipReason)] |
| 89 | + public override Task Add_column_with_defaultValue_string() => base.Add_column_with_defaultValue_string(); |
| 90 | + |
| 91 | + [Fact(Skip = SkipReason)] |
| 92 | + public override Task Add_column_with_defaultValue_datetime() => base.Add_column_with_defaultValue_datetime(); |
| 93 | + |
| 94 | + [Fact(Skip = SkipReason)] |
| 95 | + public override Task Add_column_with_defaultValueSql() => base.Add_column_with_defaultValueSql(); |
| 96 | + |
| 97 | + [Fact(Skip = SkipReason)] |
| 98 | + public override Task Add_column_with_defaultValueSql_unspecified() => base.Add_column_with_defaultValueSql_unspecified(); |
| 99 | + |
| 100 | + [Fact(Skip = SkipReason)] |
| 101 | + public override Task Add_column_with_defaultValue_unspecified() => base.Add_column_with_defaultValue_unspecified(); |
| 102 | + |
| 103 | + [Theory(Skip = SkipReason)] |
| 104 | + [InlineData(true)] |
| 105 | + [InlineData(false)] |
| 106 | + [InlineData(null)] |
| 107 | + public override Task Add_column_with_computedSql(bool? stored) => base.Add_column_with_computedSql(stored); |
| 108 | + |
| 109 | + [Fact(Skip = SkipReason)] |
| 110 | + public override Task Add_column_with_computedSql_unspecified() => base.Add_column_with_computedSql_unspecified(); |
| 111 | + |
| 112 | + [Fact(Skip = SkipReason)] |
| 113 | + public override Task Add_column_with_required() => base.Add_column_with_required(); |
| 114 | + |
| 115 | + [Fact(Skip = SkipReason)] |
| 116 | + public override Task Add_column_with_ansi() => base.Add_column_with_ansi(); |
| 117 | + |
| 118 | + [Fact(Skip = SkipReason)] |
| 119 | + public override Task Add_column_with_max_length() => base.Add_column_with_max_length(); |
| 120 | + |
| 121 | + [Fact(Skip = SkipReason)] |
| 122 | + public override Task Add_column_with_max_length_on_derived() => base.Add_column_with_max_length_on_derived(); |
| 123 | + |
| 124 | + [Fact(Skip = SkipReason)] |
| 125 | + public override Task Add_column_with_fixed_length() => base.Add_column_with_fixed_length(); |
| 126 | + |
| 127 | + [Fact(Skip = SkipReason)] |
| 128 | + public override Task Add_column_with_comment() => base.Add_column_with_comment(); |
| 129 | + |
| 130 | + [Fact(Skip = SkipReason)] |
| 131 | + public override Task Add_column_with_collation() => base.Add_column_with_collation(); |
| 132 | + |
| 133 | + [Fact(Skip = SkipReason)] |
| 134 | + public override Task Add_column_computed_with_collation() => base.Add_column_computed_with_collation(); |
| 135 | + |
| 136 | + [Fact(Skip = SkipReason)] |
| 137 | + public override Task Add_column_shared() => base.Add_column_shared(); |
| 138 | + |
| 139 | + [Fact(Skip = SkipReason)] |
| 140 | + public override Task Add_column_with_check_constraint() => base.Add_column_with_check_constraint(); |
| 141 | + |
| 142 | + [Fact(Skip = SkipReason)] |
| 143 | + public override Task Alter_column_change_type() => base.Alter_column_change_type(); |
| 144 | + |
| 145 | + [Fact(Skip = SkipReason)] |
| 146 | + public override Task Alter_column_make_required() => base.Alter_column_make_required(); |
| 147 | + |
| 148 | + [Fact(Skip = SkipReason)] |
| 149 | + public override Task Alter_column_make_required_with_index() => base.Alter_column_make_required_with_index(); |
| 150 | + |
| 151 | + [Fact(Skip = SkipReason)] |
| 152 | + public override Task Alter_column_make_required_with_composite_index() => base.Alter_column_make_required_with_composite_index(); |
| 153 | + |
| 154 | + [Theory(Skip = SkipReason)] |
| 155 | + [InlineData(true)] |
| 156 | + [InlineData(false)] |
| 157 | + [InlineData(null)] |
| 158 | + public override Task Alter_column_make_computed(bool? stored) => base.Alter_column_make_computed(stored); |
| 159 | + |
| 160 | + [Fact(Skip = SkipReason)] |
| 161 | + public override Task Alter_column_change_computed() => base.Alter_column_change_computed(); |
| 162 | + |
| 163 | + [Fact(Skip = SkipReason)] |
| 164 | + public override Task Alter_column_change_computed_type() => base.Alter_column_change_computed_type(); |
| 165 | + |
| 166 | + [Fact(Skip = SkipReason)] |
| 167 | + public override Task Alter_column_add_comment() => base.Alter_column_add_comment(); |
| 168 | + |
| 169 | + [Fact(Skip = SkipReason)] |
| 170 | + public override Task Alter_column_change_comment() => base.Alter_column_change_comment(); |
| 171 | + |
| 172 | + [Fact(Skip = SkipReason)] |
| 173 | + public override Task Alter_column_remove_comment() => base.Alter_column_remove_comment(); |
| 174 | + |
| 175 | + [Fact(Skip = SkipReason)] |
| 176 | + public override Task Alter_column_set_collation() => base.Alter_column_set_collation(); |
| 177 | + |
| 178 | + [Fact(Skip = SkipReason)] |
| 179 | + public override Task Alter_column_reset_collation() => base.Alter_column_reset_collation(); |
| 180 | + |
| 181 | + [Fact(Skip = SkipReason)] |
| 182 | + public override Task Drop_column() => base.Drop_column(); |
| 183 | + |
| 184 | + [Fact(Skip = SkipReason)] |
| 185 | + public override Task Drop_column_primary_key() => base.Drop_column_primary_key(); |
| 186 | + |
| 187 | + [Fact(Skip = SkipReason)] |
| 188 | + public override Task Rename_column() => base.Rename_column(); |
| 189 | + |
| 190 | + [Fact(Skip = SkipReason)] |
| 191 | + public override Task Create_index() => base.Create_index(); |
| 192 | + |
| 193 | + [Fact(Skip = SkipReason)] |
| 194 | + public override Task Create_index_unique() => base.Create_index_unique(); |
| 195 | + |
| 196 | + [Fact(Skip = SkipReason)] |
| 197 | + public override Task Create_index_with_filter() => base.Create_index_with_filter(); |
| 198 | + |
| 199 | + [Fact(Skip = SkipReason)] |
| 200 | + public override Task Create_unique_index_with_filter() => base.Create_unique_index_with_filter(); |
| 201 | + |
| 202 | + [Fact(Skip = SkipReason)] |
| 203 | + public override Task Drop_index() => base.Drop_index(); |
| 204 | + |
| 205 | + [Fact(Skip = SkipReason)] |
| 206 | + public override Task Rename_index() => base.Rename_index(); |
| 207 | + |
| 208 | + [Fact(Skip = SkipReason)] |
| 209 | + public override Task Add_primary_key() => base.Add_primary_key(); |
| 210 | + |
| 211 | + [Fact(Skip = SkipReason)] |
| 212 | + public override Task Add_primary_key_with_name() => base.Add_primary_key_with_name(); |
| 213 | + |
| 214 | + [Fact(Skip = SkipReason)] |
| 215 | + public override Task Add_primary_key_composite_with_name() => base.Add_primary_key_composite_with_name(); |
| 216 | + |
| 217 | + [Fact(Skip = SkipReason)] |
| 218 | + public override Task Drop_primary_key() => base.Drop_primary_key(); |
| 219 | + |
| 220 | + [Fact(Skip = SkipReason)] |
| 221 | + public override Task Add_foreign_key() => base.Add_foreign_key(); |
| 222 | + |
| 223 | + [Fact(Skip = SkipReason)] |
| 224 | + public override Task Add_foreign_key_with_name() => base.Add_foreign_key_with_name(); |
| 225 | + |
| 226 | + [Fact(Skip = SkipReason)] |
| 227 | + public override Task Drop_foreign_key() => base.Drop_foreign_key(); |
| 228 | + |
| 229 | + [Fact(Skip = SkipReason)] |
| 230 | + public override Task Add_unique_constraint() => base.Add_unique_constraint(); |
| 231 | + |
| 232 | + [Fact(Skip = SkipReason)] |
| 233 | + public override Task Add_unique_constraint_composite_with_name() => base.Add_unique_constraint_composite_with_name(); |
| 234 | + |
| 235 | + [Fact(Skip = SkipReason)] |
| 236 | + public override Task Drop_unique_constraint() => base.Drop_unique_constraint(); |
| 237 | + |
| 238 | + [Fact(Skip = SkipReason)] |
| 239 | + public override Task Add_check_constraint_with_name() => base.Add_check_constraint_with_name(); |
| 240 | + |
| 241 | + [Fact(Skip = SkipReason)] |
| 242 | + public override Task Alter_check_constraint() => base.Alter_check_constraint(); |
| 243 | + |
| 244 | + [Fact(Skip = SkipReason)] |
| 245 | + public override Task Drop_check_constraint() => base.Drop_check_constraint(); |
| 246 | + |
| 247 | + [Fact(Skip = SkipReason)] |
| 248 | + public override Task Create_sequence() => base.Create_sequence(); |
| 249 | + |
| 250 | + [Fact(Skip = SkipReason)] |
| 251 | + public override Task Create_sequence_all_settings() => base.Create_sequence_all_settings(); |
| 252 | + |
| 253 | + [Fact(Skip = SkipReason)] |
| 254 | + public override Task Alter_sequence_all_settings() => base.Alter_sequence_all_settings(); |
| 255 | + |
| 256 | + [Fact(Skip = SkipReason)] |
| 257 | + public override Task Alter_sequence_increment_by() => base.Alter_sequence_increment_by(); |
| 258 | + |
| 259 | + [Fact(Skip = SkipReason)] |
| 260 | + public override Task Drop_sequence() => base.Drop_sequence(); |
| 261 | + |
| 262 | + [Fact(Skip = SkipReason)] |
| 263 | + public override Task Rename_sequence() => base.Rename_sequence(); |
| 264 | + |
| 265 | + [Fact(Skip = SkipReason)] |
| 266 | + public override Task Move_sequence() => base.Move_sequence(); |
| 267 | + |
| 268 | + [Fact(Skip = SkipReason)] |
| 269 | + public override Task InsertDataOperation() => base.InsertDataOperation(); |
| 270 | + |
| 271 | + [Fact(Skip = SkipReason)] |
| 272 | + public override Task DeleteDataOperation_simple_key() => base.DeleteDataOperation_simple_key(); |
| 273 | + |
| 274 | + [Fact(Skip = SkipReason)] |
| 275 | + public override Task DeleteDataOperation_composite_key() => base.DeleteDataOperation_composite_key(); |
| 276 | + |
| 277 | + [Fact(Skip = SkipReason)] |
| 278 | + public override Task UpdateDataOperation_simple_key() => base.UpdateDataOperation_simple_key(); |
| 279 | + |
| 280 | + [Fact(Skip = SkipReason)] |
| 281 | + public override Task UpdateDataOperation_composite_key() => base.UpdateDataOperation_composite_key(); |
| 282 | + |
| 283 | + [Fact(Skip = SkipReason)] |
| 284 | + public override Task UpdateDataOperation_multiple_columns() => base.UpdateDataOperation_multiple_columns(); |
| 285 | + |
| 286 | + [Fact(Skip = SkipReason)] |
| 287 | + public override Task SqlOperation() => base.SqlOperation(); |
| 288 | + |
| 289 | + public class MigrationsFbFixture : MigrationsFixtureBase |
| 290 | + { |
| 291 | + protected override string StoreName => nameof(MigrationsFbTest); |
| 292 | + |
| 293 | + protected override ITestStoreFactory TestStoreFactory => FbTestStoreFactory.Instance; |
| 294 | + |
| 295 | + public override TestHelpers TestHelpers => FbTestHelpers.Instance; |
| 296 | + |
| 297 | + protected override IServiceCollection AddServices(IServiceCollection serviceCollection) |
| 298 | +#pragma warning disable EF1001 |
| 299 | + => base.AddServices(serviceCollection) |
| 300 | + .AddScoped<IDatabaseModelFactory, FbDatabaseModelFactory>(); |
| 301 | +#pragma warning restore EF1001 |
| 302 | + } |
64 | 303 | } |
65 | 304 | } |
0 commit comments