Changed samples and tests to run on netcoreapp2.0
This commit is contained in:
parent
d30400fe15
commit
50f3cd6877
|
|
@ -1,6 +1,6 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26120.4
|
||||
VisualStudioVersion = 15.0.26228.9
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}"
|
||||
EndProject
|
||||
|
|
@ -53,6 +53,7 @@ EndProject
|
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{ED7BCAC5-2796-44BD-9954-7C248263BC8B}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
build\common.props = build\common.props
|
||||
build\dependencies.props = build\dependencies.props
|
||||
build\Key.snk = build\Key.snk
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
<AspNetCoreVersion>1.2.0-*</AspNetCoreVersion>
|
||||
<CoreFxVersion>4.3.0</CoreFxVersion>
|
||||
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
|
||||
<RuntimeFrameworkVersion>2.0.0-*</RuntimeFrameworkVersion>
|
||||
<TestSdkVersion>15.0.0</TestSdkVersion>
|
||||
<XunitVersion>2.2.0</XunitVersion>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\build\dependencies.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net451;netcoreapp1.1</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.0;net451</TargetFrameworks>
|
||||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@ namespace Microsoft.AspNetCore.Http
|
|||
// Assert
|
||||
Assert.True(ReferenceEquals(context, accessor.HttpContext));
|
||||
}
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -295,8 +295,10 @@ namespace Microsoft.AspNetCore.WebUtilities
|
|||
{
|
||||
#if NET452
|
||||
return AppDomain.CurrentDomain.BaseDirectory;
|
||||
#else
|
||||
#elif NETCOREAPP2_0
|
||||
return AppContext.BaseDirectory;
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
Assert.Equal(0, stream.FlushCallCount);
|
||||
Assert.Equal(0, stream.FlushAsyncCallCount);
|
||||
}
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
|
||||
[Fact]
|
||||
|
|
@ -83,6 +86,9 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
// Assert
|
||||
Assert.Equal(0, stream.CloseCallCount);
|
||||
}
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
|
||||
[Fact]
|
||||
|
|
@ -115,8 +121,10 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
// Act
|
||||
#if NET452
|
||||
writer.Close();
|
||||
#else
|
||||
#elif NETCOREAPP2_0
|
||||
writer.Dispose();
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
|
||||
// Assert
|
||||
|
|
@ -232,7 +240,7 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
var writer = new HttpResponseStreamWriter(stream, Encoding.UTF8);
|
||||
|
||||
await writer.WriteAsync(new string('a', byteLength));
|
||||
await Assert.ThrowsAsync<IOException>(() => writer.FlushAsync());
|
||||
await Assert.ThrowsAsync<IOException>(() => writer.FlushAsync());
|
||||
|
||||
// Act
|
||||
writer.Dispose();
|
||||
|
|
@ -337,9 +345,12 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
|
||||
[Theory]
|
||||
[InlineData("你好世界", "utf-16")]
|
||||
#if !NETCOREAPP1_1
|
||||
#if NET452
|
||||
// CoreCLR does not like shift_jis as an encoding.
|
||||
[InlineData("こんにちは世界", "shift_jis")]
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
[InlineData("హలో ప్రపంచ", "iso-8859-1")]
|
||||
[InlineData("வணக்கம் உலக", "utf-32")]
|
||||
|
|
@ -368,11 +379,14 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
[InlineData('你', 1023, "utf-16")]
|
||||
[InlineData('你', 1024, "utf-16")]
|
||||
[InlineData('你', 1050, "utf-16")]
|
||||
#if !NETCOREAPP1_1
|
||||
#if NET452
|
||||
// CoreCLR does not like shift_jis as an encoding.
|
||||
[InlineData('こ', 1023, "shift_jis")]
|
||||
[InlineData('こ', 1024, "shift_jis")]
|
||||
[InlineData('こ', 1050, "shift_jis")]
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
[InlineData('హ', 1023, "iso-8859-1")]
|
||||
[InlineData('హ', 1024, "iso-8859-1")]
|
||||
|
|
@ -508,6 +522,9 @@ namespace Microsoft.AspNetCore.WebUtilities.Test
|
|||
CloseCallCount++;
|
||||
base.Close();
|
||||
}
|
||||
#elif NETCOREAPP2_0
|
||||
#else
|
||||
#error Target framework needs to be updated
|
||||
#endif
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<Import Project="..\..\build\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
|
||||
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Reference in New Issue