Adding functional tests for LinkGenerator
This commit is contained in:
parent
cc65115be1
commit
cb1393cbb1
|
|
@ -16,87 +16,87 @@
|
||||||
<BenchmarksOnlyMySqlConnectorPackageVersion>0.43.0</BenchmarksOnlyMySqlConnectorPackageVersion>
|
<BenchmarksOnlyMySqlConnectorPackageVersion>0.43.0</BenchmarksOnlyMySqlConnectorPackageVersion>
|
||||||
<BenchmarksOnlyNpgsqlEntityFrameworkCorePostgreSQLPackageVersion>2.1.1.1</BenchmarksOnlyNpgsqlEntityFrameworkCorePostgreSQLPackageVersion>
|
<BenchmarksOnlyNpgsqlEntityFrameworkCorePostgreSQLPackageVersion>2.1.1.1</BenchmarksOnlyNpgsqlEntityFrameworkCorePostgreSQLPackageVersion>
|
||||||
<BenchmarksOnlyPomeloEntityFrameworkCoreMySqlPackageVersion>2.1.1</BenchmarksOnlyPomeloEntityFrameworkCoreMySqlPackageVersion>
|
<BenchmarksOnlyPomeloEntityFrameworkCoreMySqlPackageVersion>2.1.1</BenchmarksOnlyPomeloEntityFrameworkCoreMySqlPackageVersion>
|
||||||
<InternalAspNetCoreAnalyzersPackageVersion>2.2.0-preview3-35301</InternalAspNetCoreAnalyzersPackageVersion>
|
<InternalAspNetCoreAnalyzersPackageVersion>2.2.0-preview3-35358</InternalAspNetCoreAnalyzersPackageVersion>
|
||||||
<InternalAspNetCoreSdkPackageVersion>2.2.0-preview1-20180918.1</InternalAspNetCoreSdkPackageVersion>
|
<InternalAspNetCoreSdkPackageVersion>2.2.0-preview1-20180918.1</InternalAspNetCoreSdkPackageVersion>
|
||||||
<MicrosoftAspNetCoreAllPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreAllPackageVersion>
|
<MicrosoftAspNetCoreAllPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreAllPackageVersion>
|
||||||
<MicrosoftAspNetCoreAnalyzerTestingPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreAnalyzerTestingPackageVersion>
|
<MicrosoftAspNetCoreAnalyzerTestingPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreAnalyzerTestingPackageVersion>
|
||||||
<MicrosoftAspNetCoreAntiforgeryPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreAntiforgeryPackageVersion>
|
<MicrosoftAspNetCoreAntiforgeryPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreAntiforgeryPackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
|
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationCorePackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreAuthenticationCorePackageVersion>
|
<MicrosoftAspNetCoreAuthenticationCorePackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreAuthenticationCorePackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationJwtBearerPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreAuthenticationJwtBearerPackageVersion>
|
<MicrosoftAspNetCoreAuthenticationJwtBearerPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreAuthenticationJwtBearerPackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthenticationPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreAuthenticationPackageVersion>
|
<MicrosoftAspNetCoreAuthenticationPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreAuthenticationPackageVersion>
|
||||||
<MicrosoftAspNetCoreAuthorizationPolicyPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreAuthorizationPolicyPackageVersion>
|
<MicrosoftAspNetCoreAuthorizationPolicyPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreAuthorizationPolicyPackageVersion>
|
||||||
<MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>
|
<MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>
|
||||||
<MicrosoftAspNetCoreChunkingCookieManagerSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreChunkingCookieManagerSourcesPackageVersion>
|
<MicrosoftAspNetCoreChunkingCookieManagerSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreChunkingCookieManagerSourcesPackageVersion>
|
||||||
<MicrosoftAspNetCoreCookiePolicyPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreCookiePolicyPackageVersion>
|
<MicrosoftAspNetCoreCookiePolicyPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreCookiePolicyPackageVersion>
|
||||||
<MicrosoftAspNetCoreCorsPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreCorsPackageVersion>
|
<MicrosoftAspNetCoreCorsPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreCorsPackageVersion>
|
||||||
<MicrosoftAspNetCoreDiagnosticsAbstractionsPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreDiagnosticsAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreDiagnosticsAbstractionsPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreDiagnosticsAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreDiagnosticsPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreDiagnosticsPackageVersion>
|
<MicrosoftAspNetCoreDiagnosticsPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreDiagnosticsPackageVersion>
|
||||||
<MicrosoftAspNetCoreHostingAbstractionsPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreHostingAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreHostingAbstractionsPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreHostingAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreHostingPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreHostingPackageVersion>
|
<MicrosoftAspNetCoreHostingPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreHostingPackageVersion>
|
||||||
<MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreHtmlAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreHttpExtensionsPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreHttpExtensionsPackageVersion>
|
<MicrosoftAspNetCoreHttpExtensionsPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreHttpExtensionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreHttpPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreHttpPackageVersion>
|
<MicrosoftAspNetCoreHttpPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreHttpPackageVersion>
|
||||||
<MicrosoftAspNetCoreJsonPatchPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreJsonPatchPackageVersion>
|
<MicrosoftAspNetCoreJsonPatchPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreJsonPatchPackageVersion>
|
||||||
<MicrosoftAspNetCoreLocalizationPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreLocalizationPackageVersion>
|
<MicrosoftAspNetCoreLocalizationPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreLocalizationPackageVersion>
|
||||||
<MicrosoftAspNetCoreLocalizationRoutingPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreLocalizationRoutingPackageVersion>
|
<MicrosoftAspNetCoreLocalizationRoutingPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreLocalizationRoutingPackageVersion>
|
||||||
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
|
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>
|
<MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreRangeHelperSourcesPackageVersion>
|
||||||
<MicrosoftAspNetCoreRazorDesignPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreRazorDesignPackageVersion>
|
<MicrosoftAspNetCoreRazorDesignPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreRazorDesignPackageVersion>
|
||||||
<MicrosoftAspNetCoreRazorLanguagePackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreRazorLanguagePackageVersion>
|
<MicrosoftAspNetCoreRazorLanguagePackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreRazorLanguagePackageVersion>
|
||||||
<MicrosoftAspNetCoreRazorRuntimePackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreRazorRuntimePackageVersion>
|
<MicrosoftAspNetCoreRazorRuntimePackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreRazorRuntimePackageVersion>
|
||||||
<MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>
|
<MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreRazorTagHelpersTestingSourcesPackageVersion>
|
||||||
<MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreResponseCachingAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreResponseCachingPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreResponseCachingPackageVersion>
|
<MicrosoftAspNetCoreResponseCachingPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreResponseCachingPackageVersion>
|
||||||
<MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreRoutingAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreRoutingPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreRoutingPackageVersion>
|
<MicrosoftAspNetCoreRoutingPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreRoutingPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
||||||
<MicrosoftAspNetCoreSessionPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreSessionPackageVersion>
|
<MicrosoftAspNetCoreSessionPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreSessionPackageVersion>
|
||||||
<MicrosoftAspNetCoreStaticFilesPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreStaticFilesPackageVersion>
|
<MicrosoftAspNetCoreStaticFilesPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreStaticFilesPackageVersion>
|
||||||
<MicrosoftAspNetCoreTestHostPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreTestHostPackageVersion>
|
<MicrosoftAspNetCoreTestHostPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreTestHostPackageVersion>
|
||||||
<MicrosoftAspNetCoreTestingPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreTestingPackageVersion>
|
<MicrosoftAspNetCoreTestingPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreTestingPackageVersion>
|
||||||
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview3-35301</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview3-35358</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
||||||
<MicrosoftAspNetWebApiClientPackageVersion>5.2.6</MicrosoftAspNetWebApiClientPackageVersion>
|
<MicrosoftAspNetWebApiClientPackageVersion>5.2.6</MicrosoftAspNetWebApiClientPackageVersion>
|
||||||
<MicrosoftCodeAnalysisCSharpPackageVersion>2.8.0</MicrosoftCodeAnalysisCSharpPackageVersion>
|
<MicrosoftCodeAnalysisCSharpPackageVersion>2.8.0</MicrosoftCodeAnalysisCSharpPackageVersion>
|
||||||
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>2.8.0</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
|
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>2.8.0</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
|
||||||
<MicrosoftCodeAnalysisRazorPackageVersion>2.2.0-preview3-35301</MicrosoftCodeAnalysisRazorPackageVersion>
|
<MicrosoftCodeAnalysisRazorPackageVersion>2.2.0-preview3-35358</MicrosoftCodeAnalysisRazorPackageVersion>
|
||||||
<MicrosoftDiaSymReaderNativePackageVersion>1.7.0</MicrosoftDiaSymReaderNativePackageVersion>
|
<MicrosoftDiaSymReaderNativePackageVersion>1.7.0</MicrosoftDiaSymReaderNativePackageVersion>
|
||||||
<MicrosoftExtensionsCachingMemoryPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsCachingMemoryPackageVersion>
|
<MicrosoftExtensionsCachingMemoryPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsCachingMemoryPackageVersion>
|
||||||
<MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion>
|
<MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsConfigurationPackageVersion>
|
<MicrosoftExtensionsConfigurationPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsConfigurationPackageVersion>
|
||||||
<MicrosoftExtensionsCopyOnWriteDictionarySourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsCopyOnWriteDictionarySourcesPackageVersion>
|
<MicrosoftExtensionsCopyOnWriteDictionarySourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsCopyOnWriteDictionarySourcesPackageVersion>
|
||||||
<MicrosoftExtensionsDependencyInjectionPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsDependencyInjectionPackageVersion>
|
<MicrosoftExtensionsDependencyInjectionPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsDependencyInjectionPackageVersion>
|
||||||
<MicrosoftExtensionsDependencyModelPackageVersion>2.1.0</MicrosoftExtensionsDependencyModelPackageVersion>
|
<MicrosoftExtensionsDependencyModelPackageVersion>2.1.0</MicrosoftExtensionsDependencyModelPackageVersion>
|
||||||
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
|
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
|
||||||
<MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>
|
<MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>
|
||||||
<MicrosoftExtensionsFileProvidersCompositePackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsFileProvidersCompositePackageVersion>
|
<MicrosoftExtensionsFileProvidersCompositePackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsFileProvidersCompositePackageVersion>
|
||||||
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
|
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
|
||||||
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
|
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
|
||||||
<MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>
|
<MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsLocalizationPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsLocalizationPackageVersion>
|
<MicrosoftExtensionsLocalizationPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsLocalizationPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingAbstractionsPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsLoggingAbstractionsPackageVersion>
|
<MicrosoftExtensionsLoggingAbstractionsPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsLoggingAbstractionsPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingConsolePackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsLoggingConsolePackageVersion>
|
<MicrosoftExtensionsLoggingConsolePackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||||
<MicrosoftExtensionsLoggingDebugPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsLoggingDebugPackageVersion>
|
<MicrosoftExtensionsLoggingDebugPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsLoggingDebugPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsLoggingPackageVersion>
|
<MicrosoftExtensionsLoggingPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsLoggingPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingTestingPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsLoggingTestingPackageVersion>
|
<MicrosoftExtensionsLoggingTestingPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||||
<MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion>
|
<MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsOptionsPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsOptionsPackageVersion>
|
<MicrosoftExtensionsOptionsPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsOptionsPackageVersion>
|
||||||
<MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>
|
<MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsPrimitivesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsPrimitivesPackageVersion>
|
<MicrosoftExtensionsPrimitivesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsPrimitivesPackageVersion>
|
||||||
<MicrosoftExtensionsPropertyActivatorSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsPropertyActivatorSourcesPackageVersion>
|
<MicrosoftExtensionsPropertyActivatorSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsPropertyActivatorSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsPropertyHelperSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsPropertyHelperSourcesPackageVersion>
|
<MicrosoftExtensionsPropertyHelperSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsPropertyHelperSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsSecurityHelperSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsSecurityHelperSourcesPackageVersion>
|
<MicrosoftExtensionsSecurityHelperSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsSecurityHelperSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>
|
<MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsValueStopwatchSourcesPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsValueStopwatchSourcesPackageVersion>
|
<MicrosoftExtensionsValueStopwatchSourcesPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsValueStopwatchSourcesPackageVersion>
|
||||||
<MicrosoftExtensionsWebEncodersPackageVersion>2.2.0-preview3-35301</MicrosoftExtensionsWebEncodersPackageVersion>
|
<MicrosoftExtensionsWebEncodersPackageVersion>2.2.0-preview3-35358</MicrosoftExtensionsWebEncodersPackageVersion>
|
||||||
<MicrosoftNETCoreApp20PackageVersion>2.0.9</MicrosoftNETCoreApp20PackageVersion>
|
<MicrosoftNETCoreApp20PackageVersion>2.0.9</MicrosoftNETCoreApp20PackageVersion>
|
||||||
<MicrosoftNETCoreApp21PackageVersion>2.1.3</MicrosoftNETCoreApp21PackageVersion>
|
<MicrosoftNETCoreApp21PackageVersion>2.1.3</MicrosoftNETCoreApp21PackageVersion>
|
||||||
<MicrosoftNETCoreApp22PackageVersion>2.2.0-preview2-26905-02</MicrosoftNETCoreApp22PackageVersion>
|
<MicrosoftNETCoreApp22PackageVersion>2.2.0-preview3-26927-02</MicrosoftNETCoreApp22PackageVersion>
|
||||||
<MicrosoftNetHttpHeadersPackageVersion>2.2.0-preview3-35301</MicrosoftNetHttpHeadersPackageVersion>
|
<MicrosoftNetHttpHeadersPackageVersion>2.2.0-preview3-35358</MicrosoftNetHttpHeadersPackageVersion>
|
||||||
<MicrosoftNETSdkRazorPackageVersion>2.2.0-preview3-35301</MicrosoftNETSdkRazorPackageVersion>
|
<MicrosoftNETSdkRazorPackageVersion>2.2.0-preview3-35358</MicrosoftNETSdkRazorPackageVersion>
|
||||||
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
|
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
|
||||||
<MoqPackageVersion>4.7.49</MoqPackageVersion>
|
<MoqPackageVersion>4.7.49</MoqPackageVersion>
|
||||||
<NETStandardLibrary20PackageVersion>2.0.3</NETStandardLibrary20PackageVersion>
|
<NETStandardLibrary20PackageVersion>2.0.3</NETStandardLibrary20PackageVersion>
|
||||||
|
|
|
||||||
|
|
@ -1313,7 +1313,7 @@ namespace Microsoft.AspNetCore.Mvc.Core
|
||||||
=> string.Format(CultureInfo.CurrentCulture, GetString("NoRoutesMatchedForPage"), p0);
|
=> string.Format(CultureInfo.CurrentCulture, GetString("NoRoutesMatchedForPage"), p0);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The relative page path '{0}' can only be used while executing a Razor Page. Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page.
|
/// The relative page path '{0}' can only be used while executing a Razor Page. Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page. If you are using {1} then you must provide the current {2} to use relative pages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string UrlHelper_RelativePagePathIsNotSupported
|
internal static string UrlHelper_RelativePagePathIsNotSupported
|
||||||
{
|
{
|
||||||
|
|
@ -1321,10 +1321,10 @@ namespace Microsoft.AspNetCore.Mvc.Core
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The relative page path '{0}' can only be used while executing a Razor Page. Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page.
|
/// The relative page path '{0}' can only be used while executing a Razor Page. Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page. If you are using {1} then you must provide the current {2} to use relative pages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string FormatUrlHelper_RelativePagePathIsNotSupported(object p0)
|
internal static string FormatUrlHelper_RelativePagePathIsNotSupported(object p0, object p1, object p2)
|
||||||
=> string.Format(CultureInfo.CurrentCulture, GetString("UrlHelper_RelativePagePathIsNotSupported"), p0);
|
=> string.Format(CultureInfo.CurrentCulture, GetString("UrlHelper_RelativePagePathIsNotSupported"), p0, p1, p2);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// One or more validation errors occurred.
|
/// One or more validation errors occurred.
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@
|
||||||
<value>No page named '{0}' matches the supplied values.</value>
|
<value>No page named '{0}' matches the supplied values.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="UrlHelper_RelativePagePathIsNotSupported" xml:space="preserve">
|
<data name="UrlHelper_RelativePagePathIsNotSupported" xml:space="preserve">
|
||||||
<value>The relative page path '{0}' can only be used while executing a Razor Page. Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page.</value>
|
<value>The relative page path '{0}' can only be used while executing a Razor Page. Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page. If you are using {1} then you must provide the current {2} to use relative pages.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ValidationProblemDescription_Title" xml:space="preserve">
|
<data name="ValidationProblemDescription_Title" xml:space="preserve">
|
||||||
<value>One or more validation errors occurred.</value>
|
<value>One or more validation errors occurred.</value>
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,13 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
||||||
if (string.IsNullOrEmpty(currentPagePath))
|
if (string.IsNullOrEmpty(currentPagePath))
|
||||||
{
|
{
|
||||||
// Disallow the use sibling page routing, a Razor page specific feature, from a non-page action.
|
// Disallow the use sibling page routing, a Razor page specific feature, from a non-page action.
|
||||||
throw new InvalidOperationException(Resources.FormatUrlHelper_RelativePagePathIsNotSupported(pageName));
|
// OR - this is a call from LinkGenerator where the HttpContext was not specified.
|
||||||
|
//
|
||||||
|
// We can't use a relative path in either case, because we don't know the base path.
|
||||||
|
throw new InvalidOperationException(Resources.FormatUrlHelper_RelativePagePathIsNotSupported(
|
||||||
|
pageName,
|
||||||
|
nameof(LinkGenerator),
|
||||||
|
nameof(HttpContext)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ViewEnginePath.CombinePath(currentPagePath, pageName);
|
return ViewEnginePath.CombinePath(currentPagePath, pageName);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,20 @@ namespace Microsoft.AspNetCore.Mvc.Testing
|
||||||
private static readonly ResourceManager _resourceManager
|
private static readonly ResourceManager _resourceManager
|
||||||
= new ResourceManager("Microsoft.AspNetCore.Mvc.Testing.Resources", typeof(Resources).GetTypeInfo().Assembly);
|
= new ResourceManager("Microsoft.AspNetCore.Mvc.Testing.Resources", typeof(Resources).GetTypeInfo().Assembly);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The provided Type '{0}' does not belong to an assembly with an entry point. A common cause for this error is providing a Type from a class library.
|
||||||
|
/// </summary>
|
||||||
|
internal static string InvalidAssemblyEntryPoint
|
||||||
|
{
|
||||||
|
get => GetString("InvalidAssemblyEntryPoint");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The provided Type '{0}' does not belong to an assembly with an entry point. A common cause for this error is providing a Type from a class library.
|
||||||
|
/// </summary>
|
||||||
|
internal static string FormatInvalidAssemblyEntryPoint(object p0)
|
||||||
|
=> string.Format(CultureInfo.CurrentCulture, GetString("InvalidAssemblyEntryPoint"), p0);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// No method 'public static {0} CreateWebHostBuilder(string[] args)' found on '{1}'. Alternatively, {2} can be extended and 'protected virtual {0} {3}()' can be overridden to provide your own {0} instance.
|
/// No method 'public static {0} CreateWebHostBuilder(string[] args)' found on '{1}'. Alternatively, {2} can be extended and 'protected virtual {0} {3}()' can be overridden to provide your own {0} instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -38,20 +52,6 @@ namespace Microsoft.AspNetCore.Mvc.Testing
|
||||||
internal static string FormatMissingDepsFile(object p0, object p1)
|
internal static string FormatMissingDepsFile(object p0, object p1)
|
||||||
=> string.Format(CultureInfo.CurrentCulture, GetString("MissingDepsFile"), p0, p1);
|
=> string.Format(CultureInfo.CurrentCulture, GetString("MissingDepsFile"), p0, p1);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The provided Type '{0}' does not belong to an assembly with an entry point. A common cause for this error is providing a Type from a class library.
|
|
||||||
/// </summary>
|
|
||||||
internal static string InvalidAssemblyEntryPoint
|
|
||||||
{
|
|
||||||
get => GetString("InvalidAssemblyEntryPoint");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The provided Type '{0}' does not belong to an assembly with an entry point. A common cause for this error is providing a Type from a class library.
|
|
||||||
/// </summary>
|
|
||||||
internal static string FormatInvalidAssemblyEntryPoint(string p0)
|
|
||||||
=> string.Format(CultureInfo.CurrentCulture, GetString("InvalidAssemblyEntryPoint"), p0);
|
|
||||||
|
|
||||||
private static string GetString(string name, params string[] formatterNames)
|
private static string GetString(string name, params string[] formatterNames)
|
||||||
{
|
{
|
||||||
var value = _resourceManager.GetString(name);
|
var value = _resourceManager.GetString(name);
|
||||||
|
|
|
||||||
|
|
@ -501,8 +501,11 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test.Routing
|
||||||
|
|
||||||
// Act & Assert
|
// Act & Assert
|
||||||
var ex = Assert.Throws<InvalidOperationException>(() => urlHelper.Object.Page(expected));
|
var ex = Assert.Throws<InvalidOperationException>(() => urlHelper.Object.Page(expected));
|
||||||
Assert.Equal($"The relative page path '{expected}' can only be used while executing a Razor Page. " +
|
Assert.Equal(
|
||||||
"Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page.", ex.Message);
|
$"The relative page path '{expected}' can only be used while executing a Razor Page. " +
|
||||||
|
"Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page. " +
|
||||||
|
"If you are using LinkGenerator then you must provide the current HttpContext to use relative pages.",
|
||||||
|
ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,221 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
||||||
|
{
|
||||||
|
// Functional tests for MVC's scenarios with LinkGenerator (2.2+ only)
|
||||||
|
public class LinkGeneratorTest : IClassFixture<MvcTestFixture<RoutingWebSite.StartupForLinkGenerator>>
|
||||||
|
{
|
||||||
|
public LinkGeneratorTest(MvcTestFixture<RoutingWebSite.StartupForLinkGenerator> fixture)
|
||||||
|
{
|
||||||
|
var factory = fixture.Factories.FirstOrDefault() ?? fixture.WithWebHostBuilder(ConfigureWebHostBuilder);
|
||||||
|
Client = factory.CreateDefaultClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
|
||||||
|
builder.UseStartup<RoutingWebSite.StartupForLinkGenerator>();
|
||||||
|
|
||||||
|
public HttpClient Client { get; }
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByAction_CanGeneratePathToSelf()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkToSelf");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/LG1/LinkToSelf", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByAction_CanGeneratePathToSelf_PreserveAmbientValues()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkToSelf/17?another-value=5");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/LG1/LinkToSelf/17?another-value=5", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByAction_CanGeneratePathToAnotherAction_RemovesAmbientValues()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkToAnotherAction/17?another-value=5");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/LG1/LinkToSelf?another-value=5", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByAction_CanGeneratePathToAnotherController_RemovesAmbientValues()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkToAnotherController/17?another-value=5");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/LG2/SomeAction?another-value=5", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByAction_CanGeneratePathToAnotherControllerInArea_RemovesAmbientValues()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkToAnArea/17?another-value=5");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/Admin/LG3/SomeAction?another-value=5", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByAction_CanGeneratePathWithinArea()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("Admin/LG3/LinkInsideOfArea/17");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/Admin/LG3/SomeAction", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rejected because the calling code relies on ambient values, but doesn't pass
|
||||||
|
// the HttpContext.
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByAction_FailsToGenerateLinkInsideArea()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("Admin/LG3/LinkInsideOfAreaFail/17?another-value=5");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
|
||||||
|
Assert.Equal(string.Empty, responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByAction_CanGeneratePathOutsideOfArea()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("Admin/LG3/LinkOutsideOfArea/17?another-value=5");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
|
||||||
|
Assert.Equal(string.Empty, responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByAction_CanGeneratePathFromPath()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LGAnotherPage/17");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/LG2/SomeAction", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByPage_FromPage_CanGeneratePathWithRelativePageName()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LGPage/17");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/LGAnotherPage", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByPage_CanGeneratePathToPage()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkToPage/17?another-value=4");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/LGPage?another-value=4", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetPathByPage_CanGeneratePathToPageInArea()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkToPageInArea/17?another-value=4");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("/Admin/LGAreaPage?another-value=4&handler=a-handler", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetUriByAction_CanGenerateFullUri()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkWithFullUri/17");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("http://localhost/LG1/LinkWithFullUri/17#hi", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetUriByAction_CanGenerateFullUri_WithoutHttpContext()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkWithFullUriWithoutHttpContext/17");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("https://www.example.com/LG1/LinkWithFullUri#hi", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetUriByPage_CanGenerateFullUri()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkToPageWithFullUri/17");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("http://localhost/LGPage", responseContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task GetUriByPage_CanGenerateFullUri_WithoutHttpContext()
|
||||||
|
{
|
||||||
|
// Act
|
||||||
|
var response = await Client.GetAsync("LG1/LinkToPageWithFullUriWithoutHttpContext/17");
|
||||||
|
var responseContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("https://www.example.com/Admin/LGAreaPage?handler=a-handler", responseContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Routing;
|
||||||
|
|
||||||
|
namespace RoutingWebSite
|
||||||
|
{
|
||||||
|
[Area("Admin")]
|
||||||
|
[Route("[area]/[controller]/[action]/{id?}")]
|
||||||
|
public class LG3Controller : Controller
|
||||||
|
{
|
||||||
|
private readonly LinkGenerator _linkGenerator;
|
||||||
|
|
||||||
|
public LG3Controller(LinkGenerator linkGenerator)
|
||||||
|
{
|
||||||
|
_linkGenerator = linkGenerator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SomeAction()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkInsideOfArea()
|
||||||
|
{
|
||||||
|
return _linkGenerator.GetPathByAction(HttpContext, action: nameof(SomeAction));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkInsideOfAreaFail()
|
||||||
|
{
|
||||||
|
// No ambient values - this will fail.
|
||||||
|
return _linkGenerator.GetPathByAction(controller: "LG3", action: nameof(SomeAction));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkOutsideOfArea()
|
||||||
|
{
|
||||||
|
return _linkGenerator.GetPathByAction(
|
||||||
|
HttpContext,
|
||||||
|
action: nameof(SomeAction),
|
||||||
|
controller: "LG1",
|
||||||
|
values: new { area = "", });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
@page "{id?}"
|
||||||
|
@model RoutingWebSite.Areas.Admin.Pages.LGAreaPageModel
|
||||||
|
@{
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
|
namespace RoutingWebSite.Areas.Admin.Pages
|
||||||
|
{
|
||||||
|
public class LGAreaPageModel : PageModel
|
||||||
|
{
|
||||||
|
public void OnGet()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Routing;
|
||||||
|
|
||||||
|
namespace RoutingWebSite
|
||||||
|
{
|
||||||
|
public class LG1Controller : Controller
|
||||||
|
{
|
||||||
|
private readonly LinkGenerator _linkGenerator;
|
||||||
|
|
||||||
|
public LG1Controller(LinkGenerator linkGenerator)
|
||||||
|
{
|
||||||
|
_linkGenerator = linkGenerator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkToSelf()
|
||||||
|
{
|
||||||
|
return _linkGenerator.GetPathByAction(HttpContext, values: QueryToRouteValues(HttpContext.Request.Query));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkToAnotherAction()
|
||||||
|
{
|
||||||
|
return _linkGenerator.GetPathByAction(
|
||||||
|
HttpContext,
|
||||||
|
action: nameof(LinkToSelf),
|
||||||
|
values: QueryToRouteValues(HttpContext.Request.Query));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkToAnotherController()
|
||||||
|
{
|
||||||
|
return _linkGenerator.GetPathByAction(
|
||||||
|
HttpContext,
|
||||||
|
controller: "LG2",
|
||||||
|
action: nameof(LG2Controller.SomeAction),
|
||||||
|
values: QueryToRouteValues(HttpContext.Request.Query));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkToAnArea()
|
||||||
|
{
|
||||||
|
var values = QueryToRouteValues(HttpContext.Request.Query);
|
||||||
|
values["area"] = "Admin";
|
||||||
|
|
||||||
|
return _linkGenerator.GetPathByAction(
|
||||||
|
HttpContext,
|
||||||
|
controller: "LG3",
|
||||||
|
action: nameof(LG3Controller.SomeAction),
|
||||||
|
values: values);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkToPage()
|
||||||
|
{
|
||||||
|
return _linkGenerator.GetPathByPage(
|
||||||
|
HttpContext,
|
||||||
|
page: "/LGPage",
|
||||||
|
values: QueryToRouteValues(HttpContext.Request.Query));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkToPageInArea()
|
||||||
|
{
|
||||||
|
var values = QueryToRouteValues(HttpContext.Request.Query);
|
||||||
|
values["area"] = "Admin";
|
||||||
|
return _linkGenerator.GetPathByPage(
|
||||||
|
HttpContext,
|
||||||
|
page: "/LGAreaPage",
|
||||||
|
handler: "a-handler",
|
||||||
|
values: values);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkWithFullUri()
|
||||||
|
{
|
||||||
|
return _linkGenerator.GetUriByAction(
|
||||||
|
HttpContext,
|
||||||
|
controller: "LG1",
|
||||||
|
action: nameof(LinkWithFullUri),
|
||||||
|
values: QueryToRouteValues(HttpContext.Request.Query),
|
||||||
|
fragment: new FragmentString("#hi"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkToPageWithFullUri()
|
||||||
|
{
|
||||||
|
return _linkGenerator.GetUriByPage(
|
||||||
|
HttpContext,
|
||||||
|
page: "/LGPage",
|
||||||
|
values: QueryToRouteValues(HttpContext.Request.Query));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkWithFullUriWithoutHttpContext()
|
||||||
|
{
|
||||||
|
return _linkGenerator.GetUriByAction(
|
||||||
|
scheme: "https",
|
||||||
|
host: new HostString("www.example.com"),
|
||||||
|
controller: "LG1",
|
||||||
|
action: nameof(LinkWithFullUri),
|
||||||
|
values: QueryToRouteValues(HttpContext.Request.Query),
|
||||||
|
fragment: new FragmentString("#hi"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LinkToPageWithFullUriWithoutHttpContext()
|
||||||
|
{
|
||||||
|
var values = QueryToRouteValues(HttpContext.Request.Query);
|
||||||
|
values["area"] = "Admin";
|
||||||
|
return _linkGenerator.GetUriByPage(
|
||||||
|
scheme: "https",
|
||||||
|
host: new HostString("www.example.com"),
|
||||||
|
page: "/LGAreaPage",
|
||||||
|
handler: "a-handler",
|
||||||
|
values: values);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static RouteValueDictionary QueryToRouteValues(IQueryCollection query)
|
||||||
|
{
|
||||||
|
return new RouteValueDictionary(query.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace RoutingWebSite
|
||||||
|
{
|
||||||
|
public class LG2Controller : Controller
|
||||||
|
{
|
||||||
|
public void SomeAction()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
@page "{id?}"
|
||||||
|
@model RoutingWebSite.Pages.LGAnotherPageModel
|
||||||
|
@{
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
using Microsoft.AspNetCore.Routing;
|
||||||
|
|
||||||
|
namespace RoutingWebSite.Pages
|
||||||
|
{
|
||||||
|
public class LGAnotherPageModel : PageModel
|
||||||
|
{
|
||||||
|
private readonly LinkGenerator _linkGenerator;
|
||||||
|
|
||||||
|
public LGAnotherPageModel(LinkGenerator linkGenerator)
|
||||||
|
{
|
||||||
|
_linkGenerator = linkGenerator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentResult OnGet()
|
||||||
|
{
|
||||||
|
return Content(_linkGenerator.GetPathByAction(HttpContext, action: nameof(LG2Controller.SomeAction), controller: "LG2"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
@page "{id?}"
|
||||||
|
@model BasicWebSite.Pages.LGPageModel
|
||||||
|
@{
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
using Microsoft.AspNetCore.Routing;
|
||||||
|
|
||||||
|
namespace BasicWebSite.Pages
|
||||||
|
{
|
||||||
|
public class LGPageModel : PageModel
|
||||||
|
{
|
||||||
|
private readonly LinkGenerator _linkGenerator;
|
||||||
|
|
||||||
|
public LGPageModel(LinkGenerator linkGenerator)
|
||||||
|
{
|
||||||
|
_linkGenerator = linkGenerator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentResult OnGet()
|
||||||
|
{
|
||||||
|
return Content(_linkGenerator.GetPathByPage(HttpContext, "./LGAnotherPage"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,5 +10,6 @@
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="$(MicrosoftAspNetCoreServerIISIntegrationPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="$(MicrosoftAspNetCoreServerIISIntegrationPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="$(MicrosoftAspNetCoreServerKestrelPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="$(MicrosoftAspNetCoreServerKestrelPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(MicrosoftAspNetCoreStaticFilesPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(MicrosoftAspNetCoreStaticFilesPackageVersion)" />
|
||||||
|
<PackageReference Include="Microsoft.NET.Sdk.Razor" Version="$(MicrosoftNETSdkRazorPackageVersion)" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Infrastructure;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
|
namespace RoutingWebSite
|
||||||
|
{
|
||||||
|
// A very basic routing configuration for LinkGenerator tests
|
||||||
|
public class StartupForLinkGenerator
|
||||||
|
{
|
||||||
|
public void ConfigureServices(IServiceCollection services)
|
||||||
|
{
|
||||||
|
services
|
||||||
|
.AddMvc()
|
||||||
|
.SetCompatibilityVersion(CompatibilityVersion.Latest);
|
||||||
|
services
|
||||||
|
.AddRouting(options =>
|
||||||
|
{
|
||||||
|
options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer);
|
||||||
|
});
|
||||||
|
|
||||||
|
services.AddScoped<TestResponseGenerator>();
|
||||||
|
services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Configure(IApplicationBuilder app)
|
||||||
|
{
|
||||||
|
app.UseMvcWithDefaultRoute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue