Separate Microsoft.TestCommon more - pre-restore and prebuild the project before anything that depends on it - avoid references from other test projects doing any real work - make ordering even more explicit - avoid confusion between batching builds and `$(BuildInParallel)` - turns out this also reduces the number of double writes binary logs show significantly
Doug Bunting
2023-03-14 17:10:54 -0700
Restore `pushd` and `popd` - oops, needed on TeamCity to find global.json - left this unconditional, mostly for the odd local build from another folder
Doug Bunting
2023-03-07 12:26:06 -0800
Use `msbuild` from VS 2022 if available - should ease local and TeamCity builds - make `%InstallDir%` unquoted (unlike `%vswhere%`) - shorten `%Path%` slightly - nits: - switch to 64bit `msbuild` - use script location more; no need to change directories
Doug Bunting
2023-03-03 19:15:45 -0800
Throw `PlatformNotSupportedException` in `netstandard1.3` - stop trying to use DCS in the JSON and XML formatters - if `UseDataContractSerializer` or `!UseXmlSerializer`: - `CanReadType(...)` and `CanWriteType(...)` always return `false` - `ReadFromStreamAsync(...)` and `WriteToStreamAsync(...)` always `throw` - change default XML formatter configuration to use `XmlSerializer` - adjust and disable tests in reaction - add tests of new `netstandard1.3` behavior - nits: - correct namespace of `SerializerConsistencyTests`; was alone in previous namespace - s/DataContractFormatter/XmlSerializerFormatter/ to reflect actual `XmlMediaTypeFormatter` test actions
Doug Bunting
2023-03-03 16:02:24 -0800
Support `DBNull` in `netstandard1.3` assembly - available from the System.Data.Common package - extend `DBNull` testing to include `net6.0` - s/NETCOREAPP/NETCOREAPP2_1/ where possible - fix comments in `HttpValueCollectionTest` - comments about `DBNull` there were incorrect
Doug Bunting
2023-02-28 11:59:26 -0800
Remove RuntimePortable.sln - solution name no longer makes much sense and division adds little or no value - add .NET Standard projects to Runtime.sln - add solution filters for .NET Framework and .NET Standard projects - remove `$(BuildPortable)` property and `@(SolutionsToBuild)` item group
Doug Bunting
2023-02-24 22:11:52 -0800
Use `NETSTANDARD1_3` and `Testing_NetStandard1_3` - `NETFX_CORE` name no longer makes much sense - remove both `NETFX_CORE` C# defined constant and `msbuild` property - manually-defined constant completely unnecessary in src/ code
Doug Bunting
2023-02-24 15:43:07 -0800
Rename `netstandard` Formatting projects - Formatting.NetCore and Formatting.NetStandard names no longer make sense
Doug Bunting
2023-02-24 14:55:53 -0800
Revert part of the previous commit - `ReadAsStreamAsync()` introduces unwanted behaviours - returned `Stream` cannot be read multiple times and is not recreated on next `ReadAsStreamAsync` call - method buffers the `HttpContent`, invalidating the intent of `unBuffered`
Doug Bunting
2023-02-23 17:16:41 -0800
Correct `ValidateStreamForReading(...)` - fix#389 - check `Stream` before first read attempt - check `CanRead` (not `CanSeek`) before second or later read attempts - add lots of tests of related scenarios - nit: correct a recent `HttpContentMessageExtensions` comment
Doug Bunting
2023-02-16 17:16:39 -0800
Add `Content` to all `HttpResponseMessage`s - fix#386 - reenable `net6.0` tests disabled in #384 for this issue - also, check `Stream.CanSeek` less when calculating `HttpMessageContent.ContentLength` value - use inner `HttpContent.Headers.ContentLength` if available - this changes behaviour slightly for both requests and responses - observable as `HttpMessageContent.Headers.ContentLength!=null` for empty messages - for responses, avoids `ContentLength==null` versus `ContentLength==0` inconsistencies (depending on platform) - `ContentLength==null` may still occur in some corner cases (which existed before) - e.g. when inner `HttpContent` doesn't know its length and `ReadAsStreamAsync()` hasn't completed - main change means `HttpResponseMessage`s we expose to user code are consistent across platforms - note: user code won't see `EmptyContent` in `HttpResponseMessage`s we create
Doug Bunting
2022-12-09 16:01:16 -0800
Test Formatting assemblies w/ `net6.0` - expand our text matrix to include a modern (and LTS) TFM - change how Formatting test assemblies are found - `netcoreapp` is no longer the only relevant folder prefix - use the latest .NET 6 SDK - install the 2.1.x runtime in the pipeline - don't require .NET in VS - will use binplaced `msbuild` instead - have `git` ignore the new .msbuild/ folder - react to new `Exception.Message`s in `netcoreapp3.1` - handle different formatting of argument info in `ArgumentException.Message`s - handle slightly greater `decimal` precision in a `JsonReaderException.Message` - react to new `Exception.Message`s and other changes in `net6.0` - handle different `Message` in `InvalidOperationException`s about invalid request URIs - react to other changes in `net6.0` - handle inability to mock a `Stream` if a writer passes a `ReadOnlySpan<byte>` in `net6.0` - see moq/moq4#829, moq/moq4#979, and dotnet/runtime#45152 about the issue - skip tests failing due to `HttpResponseMessage` changes - see dotnet/runtime@b48900f3b3 which introduced this - nits: - simplify define use now that `NETCOREAPP3_1_OR_GREATER` and so on are available - clean up .gitignore
Doug Bunting
2022-12-09 16:01:16 -0800
React to new Moq changes - avoid `ProtectedMock\`1.ThrowIfPublicMethod(...)` `throw`ing - use new overloads introduced in the Moq 4.11.0 release - adjust to Moq hiding the `ObjectProxy` type better - update `ControllerContext` mocking to avoid NREs - setting `HttpContext.User` on the `Object` left `get` value `null` (did nothing) - nit: use `SetupGet(...)` for another property
Doug Bunting
2023-01-24 15:10:30 -0800
Resolve xUnit issues new analyzers find - address xUnit2000 warnings - pass expected values to `Assert.Equal(...)` as correct (left) argument - make generic method types explicit to avoid `error CS0121: The call is ambiguous between the following methods or properties: ...` - note: cannot remove unnecessary xUnit1013 suppression - related bug (xunit/xunit#1466) apparently not fixed in 1.0.0 analyzers package - was xunit/xunit.analyzers#82 fix (in 2017) insufficient?
Doug Bunting
2022-08-18 19:58:59 -0700
Bump test project dependencies - Castle.Core, Moq, and xUnit versions were all out of date - hold xunit.runner.visualstudio version back in .NET SDK test projects - can be moved to latest version after we stop testing on netcoreapp2.1 - add missing xunit.analyzers reference to System.Web.Razor.Test project - move all test projects to .NET v4.6.2 (a supported framework) - remove `netstandard` reference in System.Net.Http.Formatting.Test; not needed w/ new TFM & updated references - further separate build of Microsoft.TestCommon project when invoked from NetCore.Test project - special case `RestorePackages` for this case - add System.Net.Http references to avoid conflicting versions e.g. src/ and test/ TFMs differ
Doug Bunting
2022-08-18 17:34:38 -0700
Work around missing features in `netstandard1.3` - get classes now included in NetCore assembly compiling - `SerializationAttribute` is not available - therefore `Exception` is not serializable - therefore `DefaultContractResolver.IgnoreSerializableAttribute` is not available - `Stream.(Begin|End)(Read|Write)` and `Stream.Close()` are not available
Doug Bunting
2023-01-21 15:30:12 -0800
Remove unnecessary NETFX_CORE workarounds - use `DefaultContractResolver`, `GuidAttribute`, `TypeDescriptor`, `XmlElement`, `XmlNode` classes - use `IRequiredMemberSelector` interface - use `RequestMessage.CreateResponse()` extension method - all available in `netstandard1.3` - `JsonContractResolver` use is something of a late Newtonsoft.Json version reaction - was held back by missing `IRequiredMemberSelector`
Doug Bunting
2022-11-25 15:38:49 -0800
Use `TranscodingStream` in JSON and XML formatters - remove `ReadOnlyStreamWithEncodingPreamble` and its tests - was insufficient in general and doesn't work correctly in `netstandard1.3` - see dotnet/runtime#80160
Doug Bunting
2023-01-15 21:39:13 -0800
Adjust `TranscodingStream` and related code to compile and run here - add conditions to avoid references to version-specific API - remove references to internal dotnet/runtime code - rewrite some code more generically if performance impact likely minor - use Microsoft.TestCommon instead of directly relying on Xunit in tests - use C# 9.0
Doug Bunting
2022-12-22 10:42:39 -0800
Copy `TranscodingStream` and related files from dotnet/runtime - my runtime clone was at 88868b7a781f4e5b9037b8721f30440207a7aa42
Doug Bunting
2023-01-12 22:37:12 -0800
Add `UseDataContractJsonSerializer` support in NetCore assembly - `XsdDataContractExporter` remains unavailable - update XML DCS tests to handle this (previously not in NetCore assembly) - try various workarounds - `ReadOnlyStreamWithEncodingPreamble` causes tests to hit dotnet/runtime#80160 - restriction to UTF8 when writing is a significant issue
Doug Bunting
2022-11-27 18:01:58 -0800
Add `MaxDepth` support in NetCore assembly - remove an unnecessary suppression about `MaxDepth` in `BaseJsonMediaTypeFormatter`
Doug Bunting
2022-11-27 17:51:21 -0800
Add simple classes to NetCore project - use `ICloneable` copy to get more classes compiling - helps NetCore in similar way to existing `MediaTypeHeaderValueExtensions` - use `InvalidEnumArgumentException` copy to simplify code and testing - both not available in `netstandard1.3` (or available packages) but easily duplicated
Doug Bunting
2022-11-25 14:11:18 -0800
Remove `UriQueryUtility` because `WebUtility` is available everywhere - leave test to confirm `WebUtility` continues to behave about the same - handle `WebUtility` being a `public` class - change other tests to handle `WebUtility.UrlEncode(...)` encoding to uppercase - unlike `UriQueryUtility.UrlEncode(...)`
Doug Bunting
2022-11-25 14:01:23 -0800
Remove unnecessary `ConcurrentDictionary` class - was not available in `Profile259` - leave tests to confirm correct operation w/ "real" class
Doug Bunting
2022-12-12 18:00:03 -0800
Move NetCore project to use .NET SDK - Formatting.NetCore now targets `netstandard1.3` - was `Profile259` aka `portable-net45+wp80+win8+wpa81`, approximately `netstandard1.0` - but Newtonsoft.Json.Bson supports `netstandard1.3` and up - use Newtonsoft.Json.Bson in NetCore projects - can now multi-target NetCore.Test as well
Doug Bunting
2022-08-04 11:51:24 -0700
Use latest 2.1.x .NET SDK - noticed CI builds were using old 2.1.500 - `UseDotNet@2` seems to ignore `rollForward` when using global.json :frown: - nits: - quiet `dotnet` in CI (where `dotnet` is always new) - complain about all potentially missing components when VS isn't found - add a missing blank line
Doug Bunting
2023-01-21 21:20:44 -0800
Address a few more nits - avoid repeated NuGet.exe downloads - remove extra bits in modern file versions before parsing - suppress warnings about targeting `netcoreapp2.1`
Doug Bunting
2023-01-01 20:22:44 -0800
Use .NET SDK in NetCore.Test project - for now, unable to target `netcoreapp2.1` in NetCore.Test project - Microsoft.Net.Http is not compatible - System.Net.Http types have different identities, causing compilation failures - switch to use `dotnet vstest` for any .NET Core assemblies (just one currently) - can use `Xunit` target for all .NET Framework assemblies - make XunitXml.TestLogger available for .NET Core App testing - use above test logger in repo-level testing - integrate w/ tests that use the `Xunit` target - don't import from xunit.msbuild.runner when targeting .NET Core; not needed - add `$(CopyLocalLockFileAssemblies)` to these (now both .NET SDK) test projects - xUnit assemblies were not copied (when they should have been) w/o this
Doug Bunting
2022-11-12 16:24:37 -0800
Build w/ VS 2019; restore w/ `msbuild` - handle both SDK-style and legacy projects in one way - set `$(RestorePackagesConfig)` to cover both project types - allow newer .NET SDKs to align w/ VS components - make a few `<import/>`s conditional to avoid problems in `Restore` target evaluation - restore global packages.config before building to make StyleCop available - move second copies of packages.config packages into packages/ folder - update FxCop TFM - .NET 4.0 not supported because current FxCopSdk is built against .NET 4.7.2 - suppress new warnings about old FxCop approach and not using `IFormatProvider`
Doug Bunting
2022-11-11 17:13:54 -0800