Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Don't manually define UriSection on NetFX (#19574)
Browse files Browse the repository at this point in the history
Desktop defines UriSection in the machine.config. We don't define
anything that lives outside of ConfigurationManager in the implicit
machine.config in CoreFX.
  • Loading branch information
JeremyKuhne authored and danmoseley committed May 10, 2017
1 parent 2f096d4 commit b92843e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Expand Up @@ -11,6 +11,9 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="$(CommonTestPath)\System\PlatformDetection.cs">
<Link>Common\System\PlatformDetection.cs</Link>
</Compile>
<Compile Include="$(CommonTestPath)\System\IO\TempDirectory.cs">
<Link>Common\System\IO\TempDirectory.cs</Link>
</Compile>
Expand Down
Expand Up @@ -9,7 +9,9 @@ namespace System.ConfigurationTests
{
public class UriSectionTests
{
public static string UriSectionConfiguration =
// In core we don't include framework configuration objects in the implicit
// machine.config as they don't have any function.
public static string UriSectionConfiguration_Core =
@"<?xml version='1.0' encoding='utf-8' ?>
<configuration>
<configSections>
Expand All @@ -24,11 +26,22 @@ public class UriSectionTests
</uri>
</configuration>";

public static string UriSectionConfiguration_NetFX =
@"<?xml version='1.0' encoding='utf-8' ?>
<configuration>
<uri>
<idn enabled='All' />
<iriParsing enabled='true' />
<schemeSettings>
<add name='ftp' genericUriParserOptions='DontCompressPath' />
</schemeSettings>
</uri>
</configuration>";

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "dotnet/corefx #19341")]
public void UriSectionIdnIriParsing()
{
using (var temp = new TempConfig(UriSectionConfiguration))
using (var temp = new TempConfig(PlatformDetection.IsFullFramework ? UriSectionConfiguration_NetFX : UriSectionConfiguration_Core))
{
var config = ConfigurationManager.OpenExeConfiguration(temp.ExePath);
UriSection uriSection = (UriSection)config.GetSection("uri");
Expand All @@ -38,10 +51,9 @@ public void UriSectionIdnIriParsing()
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "dotnet/corefx #19341")]
public void UriSectionSchemeSettings()
{
using (var temp = new TempConfig(UriSectionConfiguration))
using (var temp = new TempConfig(PlatformDetection.IsFullFramework ? UriSectionConfiguration_NetFX : UriSectionConfiguration_Core))
{
var config = ConfigurationManager.OpenExeConfiguration(temp.ExePath);
UriSection uriSection = (UriSection)config.GetSection("uri");
Expand Down

0 comments on commit b92843e

Please sign in to comment.