File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
ContosoUniversity.IntegrationTests Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
<ItemGroup >
14
14
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 15.5.0" />
15
+ <PackageReference Include =" roundhouse.lib" Version =" 0.8.9-PullRequest.294" />
15
16
<PackageReference Include =" xunit" Version =" 2.3.1" />
16
17
<DotNetCliToolReference Include =" dotnet-xunit" Version =" 2.3.0" />
17
18
<PackageReference Include =" Shouldly" Version =" 3.0.0-beta0003" />
Original file line number Diff line number Diff line change 9
9
using Microsoft . AspNetCore . Hosting ;
10
10
using Microsoft . Extensions . Configuration ;
11
11
using Microsoft . Extensions . DependencyInjection ;
12
+ using roundhouse ;
12
13
using Respawn ;
13
14
14
15
namespace ContosoUniversity . IntegrationTests
@@ -35,7 +36,17 @@ static SliceFixture()
35
36
_checkpoint = new Checkpoint ( ) ;
36
37
}
37
38
38
- public static Task ResetCheckpoint ( ) => _checkpoint . Reset ( _configuration . GetConnectionString ( "DefaultConnection" ) ) ;
39
+ public static Task ResetCheckpoint ( )
40
+ {
41
+ var thing = new Migrate ( ) ;
42
+ thing . Set ( cfg =>
43
+ {
44
+ cfg . ConnectionString = _configuration . GetConnectionString ( "DefaultConnection" ) ;
45
+ cfg . SqlFilesDirectory = @"..\..\ContosoUniversity\App_Data" ;
46
+ } ) ;
47
+ thing . Run ( ) ;
48
+ return _checkpoint . Reset ( _configuration . GetConnectionString ( "DefaultConnection" ) ) ;
49
+ }
39
50
40
51
public static async Task ExecuteScopeAsync ( Func < IServiceProvider , Task > action )
41
52
{
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Linq ;
4
+ using System . Reflection ;
4
5
using System . Threading . Tasks ;
5
6
using AutoMapper ;
6
7
using Microsoft . AspNetCore . Builder ;
@@ -32,7 +33,18 @@ public void ConfigureServices(IServiceCollection services)
32
33
services . AddDbContext < SchoolContext > ( options =>
33
34
options . UseSqlServer ( Configuration . GetConnectionString ( "DefaultConnection" ) ) ) ;
34
35
35
- services . AddAutoMapper ( ) ;
36
+ try
37
+ {
38
+ services . AddAutoMapper ( ) ;
39
+ }
40
+ catch ( ReflectionTypeLoadException e )
41
+ {
42
+ foreach ( var loaderException in e . LoaderExceptions )
43
+ {
44
+ Console . WriteLine ( loaderException ) ;
45
+ }
46
+ throw ;
47
+ }
36
48
37
49
services . AddMediatR ( ) ;
38
50
You can’t perform that action at this time.
0 commit comments