-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes the DbContext specimen builder (#25)
* Removes the DbContext specimen builder * Adds custom dbcontext constructor tests for sqlite customization
- Loading branch information
Showing
9 changed files
with
98 additions
and
215 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/EntityFrameworkCore.AutoFixture.Tests/Common/Persistence/TestConfigurationOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EntityFrameworkCore.AutoFixture.Tests.Common.Persistence | ||
{ | ||
public class TestConfigurationOptions | ||
{ | ||
public string SomeValue { get; set; } | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/EntityFrameworkCore.AutoFixture.Tests/Common/Persistence/TestCustomDbContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using EntityFrameworkCore.AutoFixture.Tests.Common.Persistence.Configuration; | ||
using EntityFrameworkCore.AutoFixture.Tests.Common.Persistence.Entities; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace EntityFrameworkCore.AutoFixture.Tests.Common.Persistence | ||
{ | ||
public class TestCustomDbContext : DbContext | ||
{ | ||
public TestCustomDbContext() | ||
{ | ||
} | ||
|
||
public TestCustomDbContext( | ||
DbContextOptions<TestCustomDbContext> options, | ||
ConfigurationOptions configurationOptions) | ||
: base(options) | ||
{ | ||
this.ConfigurationOptions = configurationOptions; | ||
} | ||
|
||
public ConfigurationOptions ConfigurationOptions { get; } | ||
|
||
public DbSet<Customer> Customers { get; set; } | ||
public DbSet<Item> Items { get; set; } | ||
public DbSet<Order> Orders { get; set; } | ||
|
||
protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
{ | ||
modelBuilder.ApplyConfiguration(new CustomerConfiguration()); | ||
modelBuilder.ApplyConfiguration(new ItemConfiguration()); | ||
modelBuilder.ApplyConfiguration(new OrderConfiguration()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 0 additions & 136 deletions
136
src/EntityFrameworkCore.AutoFixture.Tests/Core/DbContextSpecimenBuilderTests.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
src/EntityFrameworkCore.AutoFixture/Core/DbContextSpecimenBuilder.cs
This file was deleted.
Oops, something went wrong.