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