aspnetcore/test/Microsoft.AspNet.Mvc.Core.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
..
ApplicationModel
Authorization
DepenencyInjection Homogenize MVC startup code patterns 2015-08-16 18:48:24 -07:00
Internal
ModelBinding Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios 2015-08-18 09:57:41 -07:00
Properties
Routing
TestFiles
ActionExecutorTests.cs
ActionFilterAttributeTests.cs
BadRequestObjectResultTests.cs
BadRequestResultTests.cs
BindAttributeTest.cs
ChallengeResultTest.cs
ConsumesAttributeTests.cs
ContentResultTest.cs
ControllerActionArgumentBinderTests.cs
ControllerActionDescriptorBuilderTest.cs
ControllerActionDescriptorProviderTests.cs
ControllerActionInvokerTest.cs Add more event notification data points 2015-08-16 16:42:58 -07:00
CreatedAtActionResultTests.cs Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
CreatedAtRouteResultTests.cs Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
CreatedResultTests.cs Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
DefaultActionSelectorTests.cs
DefaultAssemblyProviderTests.cs
DefaultControllerActivatorTest.cs
DefaultControllerFactoryTest.cs Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
DefaultControllerTypeProviderTest.cs
DefaultFilterProviderTest.cs
EmptyResultTests.cs
ExcludeTypeValidationFilterExtensionsTests.cs
FilePathResultTest.cs
FileResultTest.cs
FileStreamResultTest.cs
FilterCollectionExtensionsTest.cs
FlushReportingStream.cs
FormatFilterTest.cs Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
FormatterMappingsTest.cs
HttpMethodProviderAttributesTests.cs
HttpNotFoundObjectResultTest.cs Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
HttpNotFoundResultTests.cs
HttpOkObjectResultTest.cs Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
HttpOkResultTest.cs
HttpResponseStreamWriterTest.cs
HttpStatusCodeResultTests.cs
HttpUnauthorizedResultTests.cs
KnownRouteValueConstraintTests.cs
Microsoft.AspNet.Mvc.Core.Test.xproj
MockMvcOptionsAccessor.cs
ModelBindingHelperTest.cs Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios 2015-08-18 09:57:41 -07:00
MvcCoreServiceCollectionExtensionsTest.cs React to namespace change in DI. 2015-08-11 14:10:30 -07:00
MvcOptionsTest.cs
MvcRouteHandlerTests.cs Add more event notification data points 2015-08-16 16:42:58 -07:00
NoContentFormatterTests.cs
NonDisposableStreamTest.cs
ObjectResultTests.cs Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
OutputFormatterTests.cs
ProducesAttributeTests.cs
RedirectResultTest.cs Remove IScopedInstance - use AsyncLocal for ActionContext and 2015-08-13 15:58:29 -07:00
RedirectToActionResultTest.cs Make saving TempData operate via a filter 2015-08-07 16:53:11 -07:00
RedirectToRouteResultTest.cs Make saving TempData operate via a filter 2015-08-07 16:53:11 -07:00
RequireHttpsAttributeTests.cs
ResponseCacheAttributeTest.cs
ResponseCacheFilterTest.cs
ResultFilterAttributeTest.cs
RouteDataActionConstraintTest.cs
RouteTemplateProviderAttributesTest.cs
SerializableErrorTests.cs
ServiceBasedControllerActivatorTest.cs
SimpleTypeExcludeFilterTest.cs
StreamOutputFormatterTest.cs
StringOutputFormatterTests.cs
TestController.cs
UrlHelperTest.cs Fix #2859 - Correct UrlHelper for special tokens 2015-08-13 17:04:21 -07:00
project.json