aspnetcore/test
Doug Bunting 48f09d0e8d Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios
- #2836

Part 1: Use existing property values when recursing in `MutableObjectModelBinder`
- remove `ComplexModelDTO` because that indirection made fixing this issue more difficult and doesn't add value
  - started with an old closed PR (#2241) which did some of this work
- correct `MutableObjectModelBinderTest` tests that exercised behaviour that can't occur
  - the old `dto.Results` dictionary was never incomplete; nor could it contain `null` values

Part 2: Change `MutableObjectModelBinder` to pass complex property values into binding system
- model binding no longer trounces nodes in the model tree that aren't bound
- create model instances less often in `TryUpdateModel` scenarios
  - refactor `EnsureModel()` to `GetModel()` and use appropriately
- reorder logic in `SetProperty()` and `AddToProperty()` to avoid copying to / from the same collection
  - also cleans up some code duplication

nits:
- clean up `MutableObjectModelBinderTest`
  - fix odd line wrappings and indentation
  - use `nameof()` more
  - use `string.Empty` more
  - simplify a couple of `Returns()` expressions
- make assertions in `TryUpdateModelIntegrationTest` more readable
  - no need to work through `ModelStateDictionary.Keys`
  - also use `Length` instead of `Count()`; test code but we don't need Linq at all in that test class
2015-08-18 09:57:41 -07:00
..
Microsoft.AspNet.JsonPatch.Test
…
Microsoft.AspNet.Mvc.Abstractions.Test
…
Microsoft.AspNet.Mvc.ApiExplorer.Test
…
Microsoft.AspNet.Mvc.Core.Test Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios 2015-08-18 09:57:41 -07:00
Microsoft.AspNet.Mvc.Cors.Test
…
Microsoft.AspNet.Mvc.DataAnnotations.Test [Fixes #2817] Support client side validation for all numeric types 2015-08-13 17:32:13 -07:00
Microsoft.AspNet.Mvc.Formatters.Json.Test
…
Microsoft.AspNet.Mvc.Formatters.Xml.Test
…
Microsoft.AspNet.Mvc.FunctionalTests Homogenize MVC startup code patterns 2015-08-16 18:48:24 -07:00
Microsoft.AspNet.Mvc.IntegrationTests Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios 2015-08-18 09:57:41 -07:00
Microsoft.AspNet.Mvc.Localization.Test Homogenize MVC startup code patterns 2015-08-16 18:48:24 -07:00
Microsoft.AspNet.Mvc.Razor.Host.Test React to aspnet/Razor#441 change 2015-08-16 18:22:22 -07:00
Microsoft.AspNet.Mvc.Razor.Test Homogenize MVC startup code patterns 2015-08-16 18:48:24 -07:00
Microsoft.AspNet.Mvc.TagHelpers.Test Making TagBuilder implement IHtmlContent and removing ToHtmlContent. 2015-08-14 10:58:51 -07:00
Microsoft.AspNet.Mvc.Test Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios 2015-08-18 09:57:41 -07:00
Microsoft.AspNet.Mvc.TestCommon Add more event notification data points 2015-08-16 16:42:58 -07:00
Microsoft.AspNet.Mvc.ViewFeatures.Test Add more event notification data points 2015-08-16 16:42:58 -07:00
Microsoft.AspNet.Mvc.WebApiCompatShimTest Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
WebSites Homogenize MVC startup code patterns 2015-08-16 18:48:24 -07:00