- test additional cases _close_ to these bugs as well
for #1485
- show odd `@Html.CheckBox()`, `@Html.Hidden()` behaviour in unit tests
- show odd `@Html.TextBox()` behaviour in functional tests (templates)
for #1487
- show odd `@Html.Value()` behaviour in unit tests
- show odd `@Html.RadioButton()`, `@Html.TextArea()` behaviour in functional tests
- show lack of validation attributes for `@Html.RadioButton()`, `<select>` tag helper
for #2662
- show odd `@Html.RadioButton(string.Empty)` behaviour in functional tests
for #2664
- show failures with `@Html.ListBox()` in unit tests
nits:
- test `IHtmlHelper` methods, not extensions
- use `ViewData`, not `ViewBag` in `HtmlGeneration_FormController`
- name test methods a bit more consistently
- rename `HtmlHelperValueExtensionsTest` to `HtmlHelperValueTest`
- only use MVC error message when `[BindRequired]` is violated
- update that error message to more clearly describe the problem
- enable all tests skipped due to dupe bug #2493
- update expectations of a few tests using the old messages
nits:
- rename `ModelBinding_MissingRequiredMember` to `ModelBinding_MissingBindRequiredMember`
- remove `<param>` description of removed `requiredValidator` parameter
- remove unused `MutableObjectModelBinderTest.GetRequiredValidator()`
- `CultureReplacerMiddleware` no longer helping `RazorWebSite`
- regressed with @30d11a8
- `[ReplaceCulture]` sets up the correct culture early enough for consistent formatting
- remove `CultureReplacerMiddleware` from `RazorWebSite`
- only `Startup` class we have that used this with `RequestLocalizationMiddleware`
- testing `RequestLocalizationMiddleware`; so remove the confusing extra middleware
- baselines include both expected output and design-time line mappings
- controlled by GENERATE_BASELINES
- assertions related to file content are not checked in this mode
- add design-time test of Basic.cshtml to `MvcRazorHostTest`
- regenerate all files to avoid BOM and blank line noise in future PRs
- update out-of-date design-time Basic.cs file
nits:
- make a few variable names more consistent
- make `Assembly` fields `static`
- remove unused `_resourcesAssembly` field from `ErrorPageTests`
- remove `ResourceHelpers` which was specific to functional tests
- #2456
- visible behaviours now match MVC 5
- prevent `CollectionModelBinder` from converting no value to `byte[0]`
- prevent `TypeConverterModelBinder` from converting empty value to `byte[] { '\0' }`
nit:
- remove additional delegates `ModelBindingTestHelper.GetOperationBindingContext()` calls
- a few left despite #2625 cleanup
Updated the ResponseCacheFilter Duration, Location, NoStore, and VaryByHeader properties to return one of 3 values: the specific setting applied to the instance, the setting supplied by the CachePolicy (from the constructor), or a default value. The emphasis being not to change the outward function of these properties to consumers, but to defer the evaluation of these properties until the OnActionExecuting method.
Updated the ResponseCacheFilter to check whether a cache duration has been supplied when the NoStore property is false and throw an InvalidOperationException when a duration has not been provided.
Updated ResponseCacheFilterTest to reflect the changes in behavior in the ResponseCacheFilter
Updated the ResponseCacheFilterAttributeTest to reflect the change in the behavior of the ResponseCacheFilter
Added unit tests to ResponseCacheFilterTest.cs to verify that the CachePolicy properties are properly overriden with the properties set directly on the ResponseCacheFilter.
Added functional tests to test the ability to override CacheProfile settings with properties on the ResponseCacheAttribute
This change completely removes [Activate]. In a controller, you should
constructor injection or [FromServices] to access services.
To access context items (ActionContext, ActionBindingContext, root
ViewDataDictionary) you should use the respected attribute class.
We'd like to consider streamlining this further in the future by getting
down to a single injectable context for controllers, but for now this will
have to do.
This change removes [Activate] support from TagHelpers. TagHelpers which
need access to context should use [ViewContext] to have it injected. To
access services, use constructor injection.
This change removes [Activate] from ViewComponents. Accessing context
should be done through [ViewComponentContext]. Accessing services should
be done though constructor injection.
This change adds a [Required] client validator when
ModelMetadata.IsRequired == true. The bulk of the changes here are
mechanical updates to test files.
- This involved also adding required attributes with wildcards.
- With this change AnchorTagHelpers and FormTagHelpers should no longer light up on every `<form>` or `<a>` tag.
#2581
- also rename files and directories with "GlobalImport" in name
- nearly blind but avoid "ViewImportss" in new names
- public API change: `ViewHierarchyUtility.GetGlobalImportLocations()` -> `GetViewImportsLocations()`
- primary source updates were comments, tests, and implementation details
nit:
- rename NestedGlobalImports.cs file to NestedViewImportsController.cs, matching class
with MVC5.
This change removes the behavior in model binding to validate values 'on
the wire' for requiredness instead of the looking at the model. This
restores the behavior of [Required] for model binding to the MVC5
semantics.
Also ensures that when a type is marked as skipped, any sub property which is model bound (and hence a modelstate un validated entry),
is marked as skipped (otherwise it would cause the ModelState to be invalid).
Also fixing a bug in model state dictionary FindKeyWithPrefix was not considering [0] & [0][0] as a valid prefix.
This part of the change removes default value support from ModelBinding.
Updated some unit tests to verify that it does nothing in that case.
Deleted a functional test as it was pure duplication of another
(supported) case where the property has a pre-initialized value.
Add SerializerSettings to MvcOptions and pass those options to the JsonInputFormatter and JsonOutputFormatter.
Remove custom contract resolver.
PR feedback
Pass JsonSerializerSettings to JsonPatchInputFormatter
PR feedback
Make DI JsonOutputFormatter formatter use MvcOptions SerializerSettings
Fix JsonPatchInputFormatter using null ContractResolver
Fix tests
This change dramatically simplifies the parameter discovery logic in
DefaultApiDescriptionProvider. Instead of surfacing POCO objects as
parameters, we now fully expand every model.
The rationale is that we want to show every key/value that can be set by
the user and not force consumers of ApiDescription to do that themselves.
Tests are cleaned up to match the new behavior.
This change adds more information to ModelAttributes, so that metadata
providers can look at the attributes on the property and type separately
if so desired