File tree Expand file tree Collapse file tree 7 files changed +25
-19
lines changed
AbpCompanyName.AbpProjectName.Application
AbpCompanyName.AbpProjectName.Core
AbpCompanyName.AbpProjectName.EntityFrameworkCore
AbpCompanyName.AbpProjectName.Web
AbpCompanyName.AbpProjectName.Tests
AbpCompanyName.AbpProjectName.Web.Tests Expand file tree Collapse file tree 7 files changed +25
-19
lines changed Original file line number Diff line number Diff line change 33
44 "dependencies" : {
55 "AbpCompanyName.AbpProjectName.Core" : " 1.0.0.0-*" ,
6- "Abp.EntityFrameworkCore" : " 0.10.1 " ,
7- "Abp.AutoMapper" : " 0.10.1 "
6+ "Abp.EntityFrameworkCore" : " 0.10.3 " ,
7+ "Abp.AutoMapper" : " 0.10.3 "
88 },
99
1010 "frameworks" : {
Original file line number Diff line number Diff line change 22 "version" : " 1.0.0.0-*" ,
33
44 "dependencies" : {
5- "Abp" : " 0.10.1.2 "
5+ "Abp" : " 0.10.3 "
66 },
77
88 "frameworks" : {
Original file line number Diff line number Diff line change 22 "version" : " 1.0.0.0-*" ,
33
44 "dependencies" : {
5- "Abp.EntityFrameworkCore" : " 0.10.1 " ,
5+ "Abp.EntityFrameworkCore" : " 0.10.3 " ,
66 "AbpCompanyName.AbpProjectName.Core" : " 1.0.0.0-*" ,
77 "Microsoft.EntityFrameworkCore.SqlServer" : " 1.0.0" ,
88 "Microsoft.EntityFrameworkCore.SqlServer.Design" : {
Original file line number Diff line number Diff line change 3333 "version" : " 1.0.0-preview2-final" ,
3434 "type" : " build"
3535 },
36- "Abp.AspNetCore" : " 0.10.1 "
36+ "Abp.AspNetCore" : " 0.10.3 "
3737 },
3838
3939 "tools" : {
Original file line number Diff line number Diff line change @@ -17,6 +17,17 @@ namespace AbpCompanyName.AbpProjectName.Tests
1717 public class AbpProjectNameTestModule : AbpModule
1818 {
1919 public override void PreInitialize ( )
20+ {
21+ Configuration . UnitOfWork . IsTransactional = false ; //EF Core InMemory DB does not support transactions.
22+ SetupInMemoryDb ( ) ;
23+ }
24+
25+ public override void Initialize ( )
26+ {
27+ IocManager . RegisterAssemblyByConvention ( Assembly . GetExecutingAssembly ( ) ) ;
28+ }
29+
30+ private void SetupInMemoryDb ( )
2031 {
2132 var services = new ServiceCollection ( )
2233 . AddEntityFrameworkInMemoryDatabase ( ) ;
@@ -27,19 +38,14 @@ public override void PreInitialize()
2738 ) ;
2839
2940 var builder = new DbContextOptionsBuilder < AbpProjectNameDbContext > ( ) ;
30- builder . UseInMemoryDatabase ( )
31- . UseInternalServiceProvider ( serviceProvider ) ;
32-
33- var options = builder . Options ;
41+ builder . UseInMemoryDatabase ( ) . UseInternalServiceProvider ( serviceProvider ) ;
3442
3543 IocManager . IocContainer . Register (
36- Component . For < DbContextOptions < AbpProjectNameDbContext > > ( ) . Instance ( options ) . LifestyleSingleton ( )
44+ Component
45+ . For < DbContextOptions < AbpProjectNameDbContext > > ( )
46+ . Instance ( builder . Options )
47+ . LifestyleSingleton ( )
3748 ) ;
3849 }
39-
40- public override void Initialize ( )
41- {
42- IocManager . RegisterAssemblyByConvention ( Assembly . GetExecutingAssembly ( ) ) ;
43- }
4450 }
4551}
Original file line number Diff line number Diff line change 77 "NSubstitute" : " 1.10.0" ,
88 "AbpCompanyName.AbpProjectName.Application" : " 1.0.0.0-*" ,
99 "AbpCompanyName.AbpProjectName.EntityFrameworkCore" : " 1.0.0.0-*" ,
10- "Shouldly" : " 2.8.0" ,
1110 "dotnet-test-xunit" : " 2.2.0-preview2-build1029" ,
1211 "Microsoft.EntityFrameworkCore.InMemory" : " 1.0.0" ,
1312 "xunit" : " 2.2.0-beta2-build3300" ,
1413 "xunit.extensibility.execution" : " 2.2.0-beta2-build3300" ,
1514 "xunit.runner.visualstudio" : " 2.2.0-beta2-build1149" ,
16- "Castle.Windsor.MsDependencyInjection" : " 1.0.0" ,
17- "Abp.TestBase" : " 0.10.1"
15+ "Castle.Windsor.MsDependencyInjection" : " 1.1.0" ,
16+ "Shouldly" : " 2.8.1" ,
17+ "Abp.TestBase" : " 0.10.3"
1818 },
1919
2020 "frameworks" : {
Original file line number Diff line number Diff line change 44 "testRunner" : " xunit" ,
55
66 "dependencies" : {
7- "Abp.AspNetCore.TestBase" : " 0.10.1 " ,
7+ "Abp.AspNetCore.TestBase" : " 0.10.3 " ,
88 "AbpCompanyName.AbpProjectName.Tests" : " 1.0.0.0-*" ,
99 "AbpCompanyName.AbpProjectName.Web" : " 1.0.0-*" ,
1010 "Microsoft.AspNetCore.Mvc" : " 1.0.0"
You can’t perform that action at this time.
0 commit comments