File tree Expand file tree Collapse file tree 4 files changed +17
-9
lines changed
samples/MusicStore/MusicStore.Test
MyTested.AspNetCore.Mvc.Abstractions/Internal/Application
MyTested.AspNetCore.Mvc.Configuration/Internal/Configuration Expand file tree Collapse file tree 4 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ public void ConfigureTestServices(IServiceCollection services)
36
36
37
37
TestHelper . HttpFeatureRegistrationPlugins . Add ( new SessionTestPlugin ( ) ) ;
38
38
39
+ TestHelper . ShouldPassForPlugins . Add ( new AbstractionsTestPlugin ( ) ) ;
40
+ TestHelper . ShouldPassForPlugins . Add ( new ControllersTestPlugin ( ) ) ;
41
+
39
42
services
40
43
. AddMvcTesting ( )
41
44
. AddRoutingTesting ( ) ;
Original file line number Diff line number Diff line change 1
1
{
2
- "TestAssemblyName" : " MusicStore.Test"
2
+ "General" : {
3
+ "TestAssemblyName" : " MusicStore.Test"
4
+ }
3
5
}
Original file line number Diff line number Diff line change @@ -241,12 +241,12 @@ internal static Type TryFindDefaultStartupType()
241
241
{
242
242
var applicationAssembly = Assembly . Load ( new AssemblyName ( testAssemblyName ) ) ;
243
243
244
- var startupName = TestConfiguration . General . FullStartupName ?? $ "{ Environment . EnvironmentName } Startup";
244
+ var startupType = TestConfiguration . General . StartupType ?? $ "{ Environment . EnvironmentName } Startup";
245
245
246
246
// check root of the test project
247
247
var startup =
248
- applicationAssembly . GetType ( startupName ) ??
249
- applicationAssembly . GetType ( $ "{ testAssemblyName } .{ startupName } ") ;
248
+ applicationAssembly . GetType ( startupType ) ??
249
+ applicationAssembly . GetType ( $ "{ testAssemblyName } .{ startupType } ") ;
250
250
251
251
return startup ;
252
252
}
Original file line number Diff line number Diff line change 4
4
5
5
public class GeneralTestConfiguration : BaseConfiguration
6
6
{
7
+ private const string WebAssemblyNameConfigKey = "WebAssemblyName" ;
7
8
private const string TestAssemblyNameConfigKey = "TestAssemblyName" ;
8
9
private const string AutomaticStartupConfigKey = "AutomaticStartup" ;
9
- private const string FullStartupNameConfigKey = "FullStartupName " ;
10
+ private const string StartupTypeConfigKey = "StartupType " ;
10
11
private const string ApplicationNameConfigKey = "ApplicationName" ;
11
12
private const string EnvironmentNameConfigKey = "Environment" ;
12
13
@@ -15,15 +16,17 @@ public GeneralTestConfiguration(IConfiguration configuration)
15
16
{
16
17
this . Prefix = "General" ;
17
18
}
19
+
20
+ public string WebAssemblyName => this . GetValue ( WebAssemblyNameConfigKey ) ;
18
21
19
22
public string TestAssemblyName => this . GetValue ( TestAssemblyNameConfigKey ) ;
20
23
21
- public string ApplicationName => this . GetValue ( ApplicationNameConfigKey ) ;
24
+ public bool AutomaticStartup => this . GetValue ( AutomaticStartupConfigKey , true ) ;
22
25
23
- public string EnvironmentName => this . GetValue ( EnvironmentNameConfigKey , "Test" ) ;
26
+ public string StartupType => this . GetValue ( StartupTypeConfigKey ) ;
24
27
25
- public bool AutomaticStartup => this . GetValue ( AutomaticStartupConfigKey , true ) ;
28
+ public string ApplicationName => this . GetValue ( ApplicationNameConfigKey ) ;
26
29
27
- public string FullStartupName => this . GetValue ( FullStartupNameConfigKey ) ;
30
+ public string EnvironmentName => this . GetValue ( EnvironmentNameConfigKey , "Test" ) ;
28
31
}
29
32
}
You can’t perform that action at this time.
0 commit comments