|
1 | | -using System; |
2 | | -using System.ComponentModel.DataAnnotations.Schema; |
3 | | -using System.Threading.Tasks; |
| 1 | +using System.Threading.Tasks; |
4 | 2 |
|
5 | 3 | using DotNet.Testcontainers.Containers; |
6 | 4 |
|
| 5 | +using EntityFrameworkCore.ExecuteInsert.Tests.DbContext; |
| 6 | + |
7 | 7 | using Microsoft.EntityFrameworkCore; |
8 | 8 |
|
9 | 9 | using Xunit; |
10 | 10 |
|
11 | 11 | namespace EntityFrameworkCore.ExecuteInsert.Tests.DbContainer; |
12 | 12 |
|
13 | | - |
14 | | -[PrimaryKey(nameof(Id))] |
15 | | -[Index(nameof(Name), IsUnique = true)] |
16 | | -public class TestEntity |
17 | | -{ |
18 | | - public int Id { get; set; } |
19 | | - public string Name { get; set; } = string.Empty; |
20 | | - public decimal Price { get; set; } |
21 | | - public Guid Identifier { get; set; } |
22 | | - |
23 | | - [Column(nameof(StringEnumValue), TypeName = "text")] |
24 | | - public StringEnum StringEnumValue { get; set; } |
25 | | - |
26 | | - public NumericEnum NumericEnumValue { get; set; } |
27 | | -} |
28 | | - |
29 | | -public enum NumericEnum |
30 | | -{ |
31 | | - First = 1, |
32 | | - Second = 2, |
33 | | -} |
34 | | - |
35 | | -public enum StringEnum |
36 | | -{ |
37 | | - First, |
38 | | - Second, |
39 | | -} |
40 | | - |
41 | | -public class TestDbContext : BulkDbContext |
42 | | -{ |
43 | | - public DbSet<TestEntity> TestEntities { get; set; } = null!; |
44 | | -} |
45 | | - |
46 | | -public abstract class BulkInsertProviderDbContainer<TDbContext> : IAsyncLifetime |
47 | | - where TDbContext : BulkDbContext, new() |
| 13 | +public abstract class TestDbContainer<TDbContext> : IAsyncLifetime |
| 14 | + where TDbContext : TestDbContextBase, new() |
48 | 15 | { |
49 | 16 | protected readonly IDatabaseContainer? DbContainer; |
50 | 17 |
|
51 | 18 | public TDbContext DbContext { get; private set; } = null!; |
52 | 19 |
|
53 | | - protected BulkInsertProviderDbContainer() |
| 20 | + protected TestDbContainer() |
54 | 21 | { |
55 | 22 | DbContainer = GetDbContainer(); |
56 | 23 | } |
|
0 commit comments