File tree Expand file tree Collapse file tree
samples/MusicStore/MusicStore.Test
MyTested.AspNetCore.Mvc.Abstractions/Internal/Application
MyTested.AspNetCore.Mvc.Configuration/Internal/Configuration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ public void ConfigureTestServices(IServiceCollection services)
3636
3737 TestHelper . HttpFeatureRegistrationPlugins . Add ( new SessionTestPlugin ( ) ) ;
3838
39+ TestHelper . ShouldPassForPlugins . Add ( new AbstractionsTestPlugin ( ) ) ;
40+ TestHelper . ShouldPassForPlugins . Add ( new ControllersTestPlugin ( ) ) ;
41+
3942 services
4043 . AddMvcTesting ( )
4144 . AddRoutingTesting ( ) ;
Original file line number Diff line number Diff line change 11{
2- "TestAssemblyName" : " MusicStore.Test"
2+ "General" : {
3+ "TestAssemblyName" : " MusicStore.Test"
4+ }
35}
Original file line number Diff line number Diff line change @@ -241,12 +241,12 @@ internal static Type TryFindDefaultStartupType()
241241 {
242242 var applicationAssembly = Assembly . Load ( new AssemblyName ( testAssemblyName ) ) ;
243243
244- var startupName = TestConfiguration . General . FullStartupName ?? $ "{ Environment . EnvironmentName } Startup";
244+ var startupType = TestConfiguration . General . StartupType ?? $ "{ Environment . EnvironmentName } Startup";
245245
246246 // check root of the test project
247247 var startup =
248- applicationAssembly . GetType ( startupName ) ??
249- applicationAssembly . GetType ( $ "{ testAssemblyName } .{ startupName } ") ;
248+ applicationAssembly . GetType ( startupType ) ??
249+ applicationAssembly . GetType ( $ "{ testAssemblyName } .{ startupType } ") ;
250250
251251 return startup ;
252252 }
Original file line number Diff line number Diff line change 44
55 public class GeneralTestConfiguration : BaseConfiguration
66 {
7+ private const string WebAssemblyNameConfigKey = "WebAssemblyName" ;
78 private const string TestAssemblyNameConfigKey = "TestAssemblyName" ;
89 private const string AutomaticStartupConfigKey = "AutomaticStartup" ;
9- private const string FullStartupNameConfigKey = "FullStartupName " ;
10+ private const string StartupTypeConfigKey = "StartupType " ;
1011 private const string ApplicationNameConfigKey = "ApplicationName" ;
1112 private const string EnvironmentNameConfigKey = "Environment" ;
1213
@@ -15,15 +16,17 @@ public GeneralTestConfiguration(IConfiguration configuration)
1516 {
1617 this . Prefix = "General" ;
1718 }
19+
20+ public string WebAssemblyName => this . GetValue ( WebAssemblyNameConfigKey ) ;
1821
1922 public string TestAssemblyName => this . GetValue ( TestAssemblyNameConfigKey ) ;
2023
21- public string ApplicationName => this . GetValue ( ApplicationNameConfigKey ) ;
24+ public bool AutomaticStartup => this . GetValue ( AutomaticStartupConfigKey , true ) ;
2225
23- public string EnvironmentName => this . GetValue ( EnvironmentNameConfigKey , "Test" ) ;
26+ public string StartupType => this . GetValue ( StartupTypeConfigKey ) ;
2427
25- public bool AutomaticStartup => this . GetValue ( AutomaticStartupConfigKey , true ) ;
28+ public string ApplicationName => this . GetValue ( ApplicationNameConfigKey ) ;
2629
27- public string FullStartupName => this . GetValue ( FullStartupNameConfigKey ) ;
30+ public string EnvironmentName => this . GetValue ( EnvironmentNameConfigKey , "Test" ) ;
2831 }
2932}
You can’t perform that action at this time.
0 commit comments