diff options
author | Stephen Toub <stoub@microsoft.com> | 2017-04-20 20:20:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 20:20:24 +0300 |
commit | a29a0cd92efea8cda493324c5e4ef80b31f9c558 (patch) | |
tree | f9aed82d5bbc4b0ca14096b3e8d97bf8545ccd2a /src | |
parent | df12f5d35687f757107e81c2d30416c6d5fe8aca (diff) | |
parent | 03b3d6aa1e9305269d146e5698e4a4b8297611a6 (diff) |
Merge pull request #18673 from stephentoub/dns_desktop
Fix System.Net.NameResolution tests on desktop
Diffstat (limited to 'src')
-rw-r--r-- | src/System.Net.NameResolution/tests/UnitTests/Fakes/FakeExceptionDispatchInfo.cs | 13 | ||||
-rw-r--r-- | src/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj | 5 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/System.Net.NameResolution/tests/UnitTests/Fakes/FakeExceptionDispatchInfo.cs b/src/System.Net.NameResolution/tests/UnitTests/Fakes/FakeExceptionDispatchInfo.cs new file mode 100644 index 0000000000..1b00c5f691 --- /dev/null +++ b/src/System.Net.NameResolution/tests/UnitTests/Fakes/FakeExceptionDispatchInfo.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.ExceptionServices +{ + internal class ExceptionDispatchInfo + { + public static ExceptionDispatchInfo Capture(Exception source) => null; + public static void Throw(Exception source) => throw source; + public void Throw() => throw null; + } +} diff --git a/src/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj b/src/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj index 05806efaef..de7448514d 100644 --- a/src/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj +++ b/src/System.Net.NameResolution/tests/UnitTests/System.Net.NameResolution.Unit.Tests.csproj @@ -5,6 +5,7 @@ <ProjectGuid>{239347DB-D566-48C9-9551-28AB3AD12EC3}</ProjectGuid> <StringResourcesPath>../../src/Resources/Strings.resx</StringResourcesPath> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <NoWarn>0436</NoWarn> <!-- Avoid warnings about type conflicts for types we're building in --> </PropertyGroup> <!-- Help VS understand available configurations --> <!-- Do not reference these assemblies from the TargetingPack since we are building part of the source code for tests. --> @@ -20,14 +21,13 @@ <TargetingPackExclusions Include="System.Net.NameResolution" /> </ItemGroup> - <ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'"> + <ItemGroup> <Compile Include="..\..\src\System\Net\IPHostEntry.cs"> <Link>ProductionCode\System\Net\IPHostEntry.cs</Link> </Compile> <Compile Include="..\..\src\System\Net\DNS.cs"> <Link>ProductionCode\System\Net\DNS.cs</Link> </Compile> - </ItemGroup> <ItemGroup> @@ -35,6 +35,7 @@ <Compile Include="XunitTestAssemblyAtrributes.cs" /> <!-- Fakes --> <Compile Include="Fakes\FakeContextAwareResult.cs" /> + <Compile Include="Fakes\FakeExceptionDispatchInfo.cs" /> <Compile Include="Fakes\FakeNameResolutionPal.cs" /> <Compile Include="Fakes\FakeNameResolutionUtilities.cs" /> <Compile Include="Fakes\FakeSocketExceptionFactory.cs" /> |