From 7d7d40c54f1a0f4ba1b9c4714fc8c2edf9275393 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Sat, 19 Nov 2016 22:31:17 -0800 Subject: [PATCH 1/2] Create a .NET Standard 1.1 version of System.Net.Http.Formatting.dll - bring System.Net.Http in from .NET Standard Library - use .NET Standard version of Newtonsoft.Json - bring other dependencies in transitively - create initial test project, mostly a duplicate of existing "NetCore" one nits: - write detailed information to msbuild.log - clean up trailing whitespace in a couple of test classes --- .gitignore | 3 +- Runtime.msbuild | 2 +- RuntimePortable.sln | 18 ++ build.cmd | 2 +- src/Common/CommonWebApiResources.Designer.cs | 2 +- ...tem.Net.Http.Formatting.NetStandard.csproj | 258 +++++++++++++++ .../project.json | 14 + .../Properties/AssemblyInfo.cs | 16 +- .../Properties/Resources.Designer.cs | 4 +- .../Microsoft/TestCommon/DataSets/TestData.cs | 52 +-- ...em.Net.Http.Formatting.NetCore.Test.csproj | 2 - ...et.Http.Formatting.NetStandard.Test.csproj | 298 ++++++++++++++++++ .../packages.config | 14 + .../DataSets/HttpTestData.cs | 162 +++++----- .../Internal/HttpValueCollectionTest.cs | 1 - 15 files changed, 728 insertions(+), 120 deletions(-) create mode 100644 src/System.Net.Http.Formatting.NetStandard/System.Net.Http.Formatting.NetStandard.csproj create mode 100644 src/System.Net.Http.Formatting.NetStandard/project.json create mode 100644 test/System.Net.Http.Formatting.NetStandard.Test/System.Net.Http.Formatting.NetStandard.Test.csproj create mode 100644 test/System.Net.Http.Formatting.NetStandard.Test/packages.config diff --git a/.gitignore b/.gitignore index 7df8670bf..4d0b89238 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ _[Ss]cripts *.psess *.orig *.sln.ide -.vs/ \ No newline at end of file +.vs/ +project.lock.json \ No newline at end of file diff --git a/Runtime.msbuild b/Runtime.msbuild index 34def5a44..0f4fc9eee 100644 --- a/Runtime.msbuild +++ b/Runtime.msbuild @@ -97,7 +97,7 @@ - + TestAssembly=%(TestDLLsXunit.FullPath);XmlPath=$(TestResultsDirectory)%(TestDLLsXunit.FileName)-XunitResults.xml diff --git a/RuntimePortable.sln b/RuntimePortable.sln index 9eaa7faa0..89fc0c66d 100644 --- a/RuntimePortable.sln +++ b/RuntimePortable.sln @@ -11,6 +11,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting.NetCore.Test", "test\System.Net.Http.Formatting.NetCore.Test\System.Net.Http.Formatting.NetCore.Test.csproj", "{8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting.NetStandard", "src\System.Net.Http.Formatting.NetStandard\System.Net.Http.Formatting.NetStandard.csproj", "{636CA76A-C85C-42E2-B4AA-88046279B3CA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting.NetStandard.Test", "test\System.Net.Http.Formatting.NetStandard.Test\System.Net.Http.Formatting.NetStandard.Test.csproj", "{DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CodeAnalysis|Any CPU = CodeAnalysis|Any CPU @@ -36,6 +40,18 @@ Global {8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08}.Debug|Any CPU.Build.0 = Debug|Any CPU {8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08}.Release|Any CPU.ActiveCfg = Release|Any CPU {8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08}.Release|Any CPU.Build.0 = Release|Any CPU + {636CA76A-C85C-42E2-B4AA-88046279B3CA}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU + {636CA76A-C85C-42E2-B4AA-88046279B3CA}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU + {636CA76A-C85C-42E2-B4AA-88046279B3CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {636CA76A-C85C-42E2-B4AA-88046279B3CA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {636CA76A-C85C-42E2-B4AA-88046279B3CA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {636CA76A-C85C-42E2-B4AA-88046279B3CA}.Release|Any CPU.Build.0 = Release|Any CPU + {DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU + {DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU + {DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {DECB05DF-B33A-44A0-B5DE-B14A8CE0740F}.Release|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -44,5 +60,7 @@ Global {C7060639-719B-4BD2-8A37-2F146B5A0668} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93} {FCCC4CB7-BAF7-4A57-9F89-E5766FE536C0} = {C40883CD-366D-4534-8B58-3EA0D13136DF} {8DA61DAC-FF7E-4CA1-93A0-6148DB66FD08} = {C40883CD-366D-4534-8B58-3EA0D13136DF} + {636CA76A-C85C-42E2-B4AA-88046279B3CA} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93} + {DECB05DF-B33A-44A0-B5DE-B14A8CE0740F} = {C40883CD-366D-4534-8B58-3EA0D13136DF} EndGlobalSection EndGlobal diff --git a/build.cmd b/build.cmd index 8ec4415e9..4afef96e7 100644 --- a/build.cmd +++ b/build.cmd @@ -22,7 +22,7 @@ if %ERRORLEVEL% neq 0 goto BuildFail goto BuildSuccess :BuildDefaults -%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal +%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=detailed if %ERRORLEVEL% neq 0 goto BuildFail goto BuildSuccess diff --git a/src/Common/CommonWebApiResources.Designer.cs b/src/Common/CommonWebApiResources.Designer.cs index 0944808f4..4ceb3f115 100644 --- a/src/Common/CommonWebApiResources.Designer.cs +++ b/src/Common/CommonWebApiResources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/System.Net.Http.Formatting.NetStandard/System.Net.Http.Formatting.NetStandard.csproj b/src/System.Net.Http.Formatting.NetStandard/System.Net.Http.Formatting.NetStandard.csproj new file mode 100644 index 000000000..49eb0f3a9 --- /dev/null +++ b/src/System.Net.Http.Formatting.NetStandard/System.Net.Http.Formatting.NetStandard.csproj @@ -0,0 +1,258 @@ + + + + + {636CA76A-C85C-42E2-B4AA-88046279B3CA} + Library + Properties + System.Net.Http + System.Net.Http.Formatting + $(OutputPath)NetStandard\ + $(OutputPath)$(AssemblyName).xml + $(CodeAnalysis) + ..\Strict.ruleset + /assemblycomparemode:StrongNameIgnoringVersion + false + $(DefineConstants);NETFX_CORE;ASPNETMVC;NOT_CLS_COMPLIANT;NETSTANDARD1_1 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 14.0 + 1591 + v5.0 + + + + Properties\CommonAssemblyInfo.cs + + + Common\Error.cs + + + Common\TaskHelpers.cs + + + Common\TaskHelpersExtensions.cs + + + Common\UriQueryUtility.cs + + + Common\CollectionExtensions.cs + + + Common\ListWrapperCollection.cs + + + FormattingUtilities.cs + + + Formatting\BaseJsonMediaTypeFormatter.cs + + + Formatting\BsonMediaTypeFormatter.cs + + + Formatting\DelegatingEnumerable.cs + + + Formatting\FormDataCollection.cs + + + Formatting\FormUrlEncodedJson.cs + + + Formatting\IFormatterLogger.cs + + + Formatting\JsonMediaTypeFormatter.cs + + + Formatting\MediaTypeConstants.cs + + + Formatting\MediaTypeFormatter.cs + + + Formatting\MediaTypeFormatterCollection.cs + + + Formatting\MediaTypeHeaderValueExtensions.cs + + + Formatting\MediaTypeHeaderValueRange.cs + + + Formatting\ParsedMediaTypeHeaderValue.cs + + + Formatting\Parsers\FormUrlEncodedParser.cs + + + Formatting\Parsers\HttpRequestHeaderParser.cs + + + Formatting\Parsers\HttpRequestLineParser.cs + + + Formatting\Parsers\HttpResponseHeaderParser.cs + + + Formatting\Parsers\HttpStatusLineParser.cs + + + Formatting\Parsers\InternetMessageFormatHeaderParser.cs + + + Formatting\Parsers\MimeMultipartBodyPartParser.cs + + + Formatting\Parsers\MimeMultipartParser.cs + + + Formatting\Parsers\ParserState.cs + + + Formatting\StringComparisonHelper.cs + + + Formatting\XmlMediaTypeFormatter.cs + + + Internal\HttpValueCollection.cs + + + UriExtensions.cs + + + GlobalSuppressions.cs + + + Handlers\HttpProgressEventArgs.cs + + + Handlers\ProgressContent.cs + + + Handlers\ProgressMessageHandler.cs + + + Handlers\ProgressStream.cs + + + HttpClientExtensions.cs + + + HttpClientFactory.cs + + + HttpContentExtensions.cs + + + HttpContentMessageExtensions.cs + + + HttpContentMultipartExtensions.cs + + + HttpHeaderExtensions.cs + + + HttpMessageContent.cs + + + HttpUnsortedHeaders.cs + + + HttpUnsortedRequest.cs + + + HttpUnsortedResponse.cs + + + Internal\AsyncResult.cs + + + Internal\DelegatingStream.cs + + + Internal\ReadOnlyStreamWithEncodingPreamble.cs + + + Internal\TypeExtensions.cs + + + MimeBodyPart.cs + + + MultipartFileData.cs + + + MultipartMemoryStreamProvider.cs + + + MultipartRelatedStreamProvider.cs + + + MultipartStreamProvider.cs + + + ObjectContent.cs + + + ObjectContentOfT.cs + + + PushStreamContent.cs + + + Properties\AssemblyInfo.cs + + + Properties\Resources.Designer.cs + True + True + Resources.resx + + + UnsupportedMediaTypeException.cs + + + Internal\ConcurrentDictionary.cs + + + MediaTypeHeaderValueExtensions.cs + + + + + Properties\CommonWebApiResources.Designer.cs + True + True + CommonWebApiResources.resx + + + + + Properties\CommonWebApiResources.resx + ResXFileCodeGenerator + CommonWebApiResources.Designer.cs + + + + + Properties\Resources.resx + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + CodeAnalysisDictionary.xml + + + + + + + + \ No newline at end of file diff --git a/src/System.Net.Http.Formatting.NetStandard/project.json b/src/System.Net.Http.Formatting.NetStandard/project.json new file mode 100644 index 000000000..8268e6a80 --- /dev/null +++ b/src/System.Net.Http.Formatting.NetStandard/project.json @@ -0,0 +1,14 @@ +{ + "supports": {}, + "dependencies": { + "NETStandard.Library": "1.6.1", + "Newtonsoft.Json": "9.0.1", + "System.ComponentModel.EventBasedAsync": "4.3.0", + "System.Diagnostics.Contracts": "4.3.0", + "System.Runtime.Serialization.Xml": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "frameworks": { + "netstandard1.1": {} + } +} \ No newline at end of file diff --git a/src/System.Net.Http.Formatting/Properties/AssemblyInfo.cs b/src/System.Net.Http.Formatting/Properties/AssemblyInfo.cs index 0212e8e7d..6186d7b3b 100644 --- a/src/System.Net.Http.Formatting/Properties/AssemblyInfo.cs +++ b/src/System.Net.Http.Formatting/Properties/AssemblyInfo.cs @@ -3,18 +3,26 @@ using System.Reflection; using System.Runtime.CompilerServices; +#if !NETFX_CORE || NETSTANDARD1_1 using System.Runtime.InteropServices; +#endif -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("System.Net.Http.Formatting")] [assembly: AssemblyDescription("")] -#if !NETFX_CORE // GuidAttibute is not supported in portable libraries + +#if !NETFX_CORE || NETSTANDARD1_1 // GuidAttibute is not supported in portable libraries but is in .NET Standard. [assembly: Guid("7fa1ae84-36e2-46b6-812c-c985a8e65e9a")] +#endif + +#if NETSTANDARD1_1 +[assembly: InternalsVisibleTo("System.Net.Http.Formatting.NetStandard.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +#elif NETFX_CORE +[assembly: InternalsVisibleTo("System.Net.Http.Formatting.NetCore.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +#else [assembly: InternalsVisibleTo("System.Net.Http.Formatting.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] [assembly: InternalsVisibleTo("System.Net.Http.Formatting.Test.Integration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] -#else -[assembly: InternalsVisibleTo("System.Net.Http.Formatting.NetCore.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] #endif diff --git a/src/System.Net.Http.Formatting/Properties/Resources.Designer.cs b/src/System.Net.Http.Formatting/Properties/Resources.Designer.cs index 5f9439f29..dab0cdd71 100644 --- a/src/System.Net.Http.Formatting/Properties/Resources.Designer.cs +++ b/src/System.Net.Http.Formatting/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34003 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -678,7 +678,7 @@ internal static string ReadAsMimeMultipartUnexpectedTermination { } /// - /// Looks up a localized string similar to The '{0}' method in '{1}' returned null. It must return a RemoteStreamInfo instance containing a writable stream and a valid URL.. + /// Looks up a localized string similar to The '{0}' method in '{1}' returned null. It must return a RemoteStreamResult instance containing a writable stream and a valid URL.. /// internal static string RemoteStreamInfoCannotBeNull { get { diff --git a/test/Microsoft.TestCommon/Microsoft/TestCommon/DataSets/TestData.cs b/test/Microsoft.TestCommon/Microsoft/TestCommon/DataSets/TestData.cs index 3afa6ce7b..6f0cc052a 100644 --- a/test/Microsoft.TestCommon/Microsoft/TestCommon/DataSets/TestData.cs +++ b/test/Microsoft.TestCommon/Microsoft/TestCommon/DataSets/TestData.cs @@ -160,19 +160,19 @@ public abstract class TestData /// /// Expected permutations of non supported file paths. /// - public static readonly TestData NotSupportedFilePaths = new RefTypeTestData(() => new List() { + public static readonly TestData NotSupportedFilePaths = new RefTypeTestData(() => new List() { "cc:\\a\\b", }); /// /// Expected permutations of invalid file paths. /// - public static readonly TestData InvalidNonNullFilePaths = new RefTypeTestData(() => new List() { + public static readonly TestData InvalidNonNullFilePaths = new RefTypeTestData(() => new List() { String.Empty, "", - " ", + " ", " ", - "\t\t \n ", + "\t\t \n ", "c:\\ab", "c:\\a\"b", @@ -200,7 +200,7 @@ public abstract class TestData " ", // one space " ", // multiple spaces " data ", // leading and trailing whitespace - "\t\t \n ", + "\t\t \n ", "Some String!"}); /// @@ -213,31 +213,31 @@ public abstract class TestData /// A read-only collection of value type test data. /// public static readonly ReadOnlyCollection ValueTypeTestDataCollection = new ReadOnlyCollection(new TestData[] { - CharTestData, - IntTestData, - UintTestData, - ShortTestData, - UshortTestData, - LongTestData, - UlongTestData, - ByteTestData, - SByteTestData, + CharTestData, + IntTestData, + UintTestData, + ShortTestData, + UshortTestData, + LongTestData, + UlongTestData, + ByteTestData, + SByteTestData, BoolTestData, - DoubleTestData, - FloatTestData, - DecimalTestData, - TimeSpanTestData, - GuidTestData, - DateTimeOffsetTestData, - SimpleEnumTestData, + DoubleTestData, + FloatTestData, + DecimalTestData, + TimeSpanTestData, + GuidTestData, + DateTimeOffsetTestData, + SimpleEnumTestData, LongEnumTestData, FlagsEnumTestData}); /// /// A read-only collection of reference type test data. /// - public static readonly ReadOnlyCollection RefTypeTestDataCollection = new ReadOnlyCollection(new TestData[] { - StringTestData, + public static readonly ReadOnlyCollection RefTypeTestDataCollection = new ReadOnlyCollection(new TestData[] { + StringTestData, ISerializableTypeTestData}); /// @@ -254,7 +254,7 @@ public abstract class TestData IntTestData, BoolTestData, SimpleEnumTestData, - StringTestData, + StringTestData, }); private Dictionary registeredTestDataVariations; @@ -330,7 +330,7 @@ public object GetAsTestDataOrNull(TestDataVariations variation) /// - /// Allows derived classes to register a that will + /// Allows derived classes to register a that will /// provide test data for a given variation. /// /// The variation with which to register the r. @@ -358,7 +358,7 @@ public TestDataVariationProvider(Type type, Func testDataProvider) /// - /// A generic base class for test data. + /// A generic base class for test data. /// /// The type associated with the test data. public abstract class TestData : TestData, IEnumerable diff --git a/test/System.Net.Http.Formatting.NetCore.Test/System.Net.Http.Formatting.NetCore.Test.csproj b/test/System.Net.Http.Formatting.NetCore.Test/System.Net.Http.Formatting.NetCore.Test.csproj index 5218246cb..f8051e292 100644 --- a/test/System.Net.Http.Formatting.NetCore.Test/System.Net.Http.Formatting.NetCore.Test.csproj +++ b/test/System.Net.Http.Formatting.NetCore.Test/System.Net.Http.Formatting.NetCore.Test.csproj @@ -10,8 +10,6 @@ System.Net.Http.Formatting.NetCore.Test ..\..\bin\$(Configuration)\Test\NetCore\ $(DefineConstants);NETFX_CORE - - diff --git a/test/System.Net.Http.Formatting.NetStandard.Test/System.Net.Http.Formatting.NetStandard.Test.csproj b/test/System.Net.Http.Formatting.NetStandard.Test/System.Net.Http.Formatting.NetStandard.Test.csproj new file mode 100644 index 000000000..d442f4ca0 --- /dev/null +++ b/test/System.Net.Http.Formatting.NetStandard.Test/System.Net.Http.Formatting.NetStandard.Test.csproj @@ -0,0 +1,298 @@ + + + + + + {DECB05DF-B33A-44A0-B5DE-B14A8CE0740F} + Library + Properties + System.Net.Http + System.Net.Http.Formatting.NetStandard.Test + ..\..\bin\$(Configuration)\Test\NetStandard\ + $(DefineConstants);NETFX_CORE + + + + ..\..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + True + + + ..\..\packages\Moq.4.5.28\lib\net45\Moq.dll + True + + + ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + True + + + + + + + + + ..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll + True + + + ..\..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll + True + + + ..\..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll + True + + + ..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll + True + + + + + False + + + + + Formatting\BsonMediaTypeFormatterTests.cs + + + Internal\FormDataCollectionTests.cs + + + Internal\FormUrlEncodedJsonTests.cs + + + Formatting\JsonNetSerializationTest.cs + + + Formatting\JsonNetValidationTest.cs + + + Internal\FormUrlEncodedParserTests.cs + + + HttpValueCollectionTest.cs + + + Internal\ReadOnlyStreamWithEncodingPreambleTest.cs + + + MimeBodyPartTest.cs + + + HttpHeaderExtensionsTest.cs + + + HttpUnsortedResponseTest.cs + + + HttpUnsortedRequestTest.cs + + + SFormatting\tringComparisonHelperTest.cs + + + Mocks\MockAsyncCallback.cs + + + Mocks\MockCompletedAsyncResult.cs + + + HttpClientFactoryTest.cs + + + Handlers\ProgressContentTest.cs + + + Handlers\ProgressStreamTest.cs + + + Handlers\HttpProgressEventArgsTest.cs + + + MultipartRelatedStreamProviderTests.cs + + + MultipartStreamProviderTestBase.cs + + + MultipartFileDataTest.cs + + + DataSets\Types\DataContractEnum.cs + + + DataSets\Types\DataContractType.cs + + + DataSets\Types\DerivedDataContractType.cs + + + DataSets\Types\DerivedJsonMediaTypeFormatter.cs + + + DataSets\Types\DerivedWcfPocoType.cs + + + DataSets\Types\DerivedXmlMediaTypeFormatter.cs + + + DataSets\Types\DerivedXmlSerializableType.cs + + + DataSets\HttpTestData.cs + + + DataSets\Types\INotJsonSerializable.cs + + + DataSets\Types\WcfPocoType.cs + + + DataSets\Types\XmlSerializableType.cs + + + Formatting\SerializerConsistencyTests.cs + + + Formatting\XmlSerializerMediaTypeFormatterTests.cs + + + Formatting\MediaTypeFormatterTestBase.cs + + + HttpClientExtensionsTest.cs + + + Internal\AsyncResultTest.cs + + + Internal\DelegatingStreamTest.cs + + + Mocks\MockDelegatingHandler.cs + + + Mocks\MockDelegatingStream.cs + + + Mocks\MockProgressEventHandler.cs + + + Mocks\TestableHttpMessageHandler.cs + + + UriExtensionsTests.cs + + + UriQueryDataSet.cs + + + FormattingUtilitiesTests.cs + + + Formatting\JsonMediaTypeFormatterTests.cs + + + Formatting\MediaTypeConstantsTests.cs + + + Formatting\MediaTypeFormatterCollectionTests.cs + + + Formatting\MediaTypeFormatterTests.cs + + + Formatting\MediaTypeHeaderValueExtensionsTests.cs + + + Formatting\ParsedMediaTypeHeaderValueTests.cs + + + Formatting\XmlMediaTypeFormatterTests.cs + + + HttpContentMessageExtensionsTests.cs + + + HttpContentMultipartExtensionsTests.cs + + + HttpMessageContentTests.cs + + + Formatting\Parsers\HttpRequestHeaderParserTests.cs + + + Formatting\Parsers\HttpRequestLineParserTests.cs + + + Formatting\Parsers\HttpResponseHeaderParserTests.cs + + + Formatting\Parsers\HttpStatusLineParserTests.cs + + + Formatting\Parsers\InternetMessageFormatHeaderParserTests.cs + + + Formatting\Parsers\MimeMultipartParserTests.cs + + + MultipartMemoryStreamProviderTests.cs + + + ObjectContentOfTTests.cs + + + ObjectContentTests.cs + + + ParserData.cs + + + Mocks\MockHttpContent.cs + + + Mocks\MockMediaTypeFormatter.cs + + + HttpContentExtensionsTest.cs + + + PushStreamContentTest.cs + + + ProgressMessageHandlerTest.cs + + + ConcurrentDictionaryTests.cs + + + + + {636ca76a-c85c-42e2-b4aa-88046279b3ca} + System.Net.Http.Formatting.NetStandard + + + {fccc4cb7-baf7-4a57-9f89-e5766fe536c0} + Microsoft.TestCommon + + + + + Designer + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/test/System.Net.Http.Formatting.NetStandard.Test/packages.config b/test/System.Net.Http.Formatting.NetStandard.Test/packages.config new file mode 100644 index 000000000..f7e5ccaa9 --- /dev/null +++ b/test/System.Net.Http.Formatting.NetStandard.Test/packages.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/System.Net.Http.Formatting.Test/DataSets/HttpTestData.cs b/test/System.Net.Http.Formatting.Test/DataSets/HttpTestData.cs index 83c306f1a..94cc7782b 100644 --- a/test/System.Net.Http.Formatting.Test/DataSets/HttpTestData.cs +++ b/test/System.Net.Http.Formatting.Test/DataSets/HttpTestData.cs @@ -27,8 +27,8 @@ public static TestData StandardHttpMethods { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { HttpMethod.Head, HttpMethod.Get, HttpMethod.Post, @@ -44,8 +44,8 @@ public static TestData CustomHttpMethods { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new HttpMethod("Custom") }); } @@ -132,21 +132,21 @@ public static ReadOnlyCollection ConvertablePrimitiveValueTypes { return new ReadOnlyCollection(new TestData[] { - TestData.CharTestData, - TestData.IntTestData, - TestData.UintTestData, - TestData.ShortTestData, - TestData.UshortTestData, - TestData.LongTestData, - TestData.UlongTestData, - TestData.ByteTestData, - TestData.SByteTestData, + TestData.CharTestData, + TestData.IntTestData, + TestData.UintTestData, + TestData.ShortTestData, + TestData.UshortTestData, + TestData.LongTestData, + TestData.UlongTestData, + TestData.ByteTestData, + TestData.SByteTestData, TestData.BoolTestData, - TestData.DoubleTestData, - TestData.FloatTestData, - TestData.DecimalTestData, - TestData.TimeSpanTestData, - TestData.GuidTestData, + TestData.DoubleTestData, + TestData.FloatTestData, + TestData.DecimalTestData, + TestData.TimeSpanTestData, + TestData.GuidTestData, TestData.DateTimeTestData, TestData.DateTimeOffsetTestData }); @@ -159,9 +159,9 @@ public static ReadOnlyCollection ConvertableEnumTypes { return new ReadOnlyCollection(new TestData[] { - TestData.SimpleEnumTestData, + TestData.SimpleEnumTestData, TestData.LongEnumTestData, - TestData.FlagsEnumTestData, + TestData.FlagsEnumTestData, DataContractEnumTestData }); } @@ -180,8 +180,8 @@ public static TestData StandardBsonMediaTypes { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new MediaTypeHeaderValue("application/bson"), }); } @@ -191,8 +191,8 @@ public static TestData StandardJsonMediaTypes { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new MediaTypeHeaderValue("application/json"), new MediaTypeHeaderValue("text/json") }); @@ -203,8 +203,8 @@ public static TestData StandardXmlMediaTypes { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new MediaTypeHeaderValue("application/xml"), new MediaTypeHeaderValue("text/xml") }); @@ -215,8 +215,8 @@ public static TestData StandardODataMediaTypes { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new MediaTypeHeaderValue("application/atom+xml"), new MediaTypeHeaderValue("application/json"), }); @@ -227,8 +227,8 @@ public static TestData StandardFormUrlEncodedMediaTypes { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new MediaTypeHeaderValue("application/x-www-form-urlencoded") }); } @@ -238,8 +238,8 @@ public static TestData StandardJsonMediaTypeStrings { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { "application/json", "text/json" }); @@ -250,8 +250,8 @@ public static TestData StandardXmlMediaTypeStrings { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { "application/xml", "text/xml" }); @@ -273,8 +273,8 @@ public static TestData IllegalMediaTypeStrings { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { "\0", "9\r\n" }); @@ -285,8 +285,8 @@ public static TestData StandardEncodings { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true), new UnicodeEncoding(bigEndian: false, byteOrderMark: true, throwOnInvalidBytes: true), }); @@ -324,8 +324,8 @@ public static TestData StandardMediaTypesWithQu { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new MediaTypeWithQualityHeaderValue("application/json", .1) { CharSet="utf-8"}, new MediaTypeWithQualityHeaderValue("text/json", .2) { CharSet="utf-8"}, new MediaTypeWithQualityHeaderValue("application/xml", .3) { CharSet="utf-8"}, @@ -339,8 +339,8 @@ public static TestData StandardHttpContents { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new ByteArrayContent(new byte[0]), new FormUrlEncodedContent(new KeyValuePair[0]), new MultipartContent(), @@ -365,8 +365,8 @@ public static TestData QueryStringMappings { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new QueryStringMapping("format", "json", new MediaTypeHeaderValue("application/json")) }); } @@ -378,8 +378,8 @@ public static TestData LegalUriPathExtensions get { return new RefTypeTestData(() => new List() - { - "xml", + { + "xml", "json" }); } @@ -390,9 +390,9 @@ public static TestData LegalQueryStringParameterNames get { return new RefTypeTestData(() => new List() - { - "format", - "fmt" + { + "format", + "fmt" }); } } @@ -402,9 +402,9 @@ public static TestData LegalHttpHeaderNames get { return new RefTypeTestData(() => new List() - { - "x-requested-with", - "some-random-name" + { + "x-requested-with", + "some-random-name" }); } } @@ -414,8 +414,8 @@ public static TestData LegalHttpHeaderValues get { return new RefTypeTestData(() => new List() - { - "1", + { + "1", "XMLHttpRequest", "\"quoted-string\"" }); @@ -427,9 +427,9 @@ public static TestData LegalQueryStringParameterValues get { return new RefTypeTestData(() => new List() - { - "xml", - "json" + { + "xml", + "json" }); } } @@ -439,8 +439,8 @@ public static TestData LegalMediaRangeStrings get { return new RefTypeTestData(() => new List() - { - "application/*", + { + "application/*", "text/*" }); } @@ -473,9 +473,9 @@ public static TestData IllegalMediaRangeStrings get { return new RefTypeTestData(() => new List() - { - "application/xml", - "text/xml" + { + "application/xml", + "text/xml" }); } } @@ -494,8 +494,8 @@ public static TestData StandardFormatters { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new XmlMediaTypeFormatter(), new JsonMediaTypeFormatter(), #if !NETFX_CORE // not present in portable library version @@ -517,8 +517,8 @@ public static TestData DerivedFormatters { get { - return new RefTypeTestData(() => new List() - { + return new RefTypeTestData(() => new List() + { new DerivedXmlMediaTypeFormatter(), new DerivedJsonMediaTypeFormatter(), #if !NETFX_CORE // not present in portable library version @@ -546,8 +546,8 @@ public static TestData LegalHttpAddresses get { return new RefTypeTestData(() => new List() - { - "http://somehost", + { + "http://somehost", "https://somehost", }); } @@ -558,9 +558,9 @@ public static TestData AddressesWithIllegalSchemes get { return new RefTypeTestData(() => new List() - { - "net.tcp://somehost", - "file://somehost", + { + "net.tcp://somehost", + "file://somehost", "net.pipe://somehost", "mailto:somehost", "ftp://somehost", @@ -585,7 +585,7 @@ public static ReadOnlyCollection RepresentativeValueAndRefTypeTestData TestData.IntTestData, TestData.BoolTestData, TestData.SimpleEnumTestData, - TestData.StringTestData, + TestData.StringTestData, TestData.DateTimeTestData, TestData.DateTimeOffsetTestData, TestData.TimeSpanTestData, @@ -599,7 +599,7 @@ public static TestData NullContentHttpRequestMessages get { return new RefTypeTestData(() => new List() - { + { new HttpRequestMessage() { Content = null }, }); } @@ -610,8 +610,8 @@ public static TestData LegalHttpParameterNames get { return new RefTypeTestData(() => new List() - { - "文", + { + "文", "A", "a", "b", @@ -630,7 +630,7 @@ public static TestData LegalHttpParameterTypes get { return new RefTypeTestData(() => new List() - { + { typeof(string), typeof(byte[]), typeof(byte[][]), @@ -693,12 +693,12 @@ public static RefTypeTestData UriTestDataStrings get { return new RefTypeTestData(() => new List() - { - "http://somehost", - "http://somehost:8080", + { + "http://somehost", + "http://somehost:8080", "http://somehost/", - "http://somehost:8080/", - "http://somehost/somepath", + "http://somehost:8080/", + "http://somehost/somepath", "http://somehost/somepath/", "http://somehost/somepath?somequery=somevalue" }); diff --git a/test/System.Net.Http.Formatting.Test/Internal/HttpValueCollectionTest.cs b/test/System.Net.Http.Formatting.Test/Internal/HttpValueCollectionTest.cs index 4feb308a1..f4b388d7b 100644 --- a/test/System.Net.Http.Formatting.Test/Internal/HttpValueCollectionTest.cs +++ b/test/System.Net.Http.Formatting.Test/Internal/HttpValueCollectionTest.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; -using System.Collections.Specialized; using System.Linq; using System.Net.Http.Formatting; #if !NETFX_CORE From abee3354194ec8a51bade2582861f231372caaef Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Thu, 8 Dec 2016 16:49:43 -0800 Subject: [PATCH 2/2] Move to LTS versions of .NET Standard dependencies --- .../project.json | 10 +++++----- .../packages.config | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/System.Net.Http.Formatting.NetStandard/project.json b/src/System.Net.Http.Formatting.NetStandard/project.json index 8268e6a80..0f162d655 100644 --- a/src/System.Net.Http.Formatting.NetStandard/project.json +++ b/src/System.Net.Http.Formatting.NetStandard/project.json @@ -1,12 +1,12 @@ { "supports": {}, "dependencies": { - "NETStandard.Library": "1.6.1", + "NETStandard.Library": "1.6.0", "Newtonsoft.Json": "9.0.1", - "System.ComponentModel.EventBasedAsync": "4.3.0", - "System.Diagnostics.Contracts": "4.3.0", - "System.Runtime.Serialization.Xml": "4.3.0", - "System.Xml.XmlSerializer": "4.3.0" + "System.ComponentModel.EventBasedAsync": "4.0.11", + "System.Diagnostics.Contracts": "4.0.1", + "System.Runtime.Serialization.Xml": "4.1.1", + "System.Xml.XmlSerializer": "4.0.11" }, "frameworks": { "netstandard1.1": {} diff --git a/test/System.Net.Http.Formatting.NetStandard.Test/packages.config b/test/System.Net.Http.Formatting.NetStandard.Test/packages.config index f7e5ccaa9..f648da4ad 100644 --- a/test/System.Net.Http.Formatting.NetStandard.Test/packages.config +++ b/test/System.Net.Http.Formatting.NetStandard.Test/packages.config @@ -3,7 +3,6 @@ -