Commit Graph

38 Commits

Author SHA1 Message Date
Pranav K e1eaf6a6e0
Cleanup TestCommon 2018-05-18 10:45:57 -07:00
John Luo c35030267c Update usage of TestSink 2018-04-13 10:21:41 -07:00
Ryan Nowak 747420e5aa
Compatibility switches (#7142)
* [Design] Compatibility switches

This introduces a pattern for versioning breaking behaviour changes in
minor releases of MVC.

The general plan is that application developers choose a release version
(2.0, 2.1, Latest) as their baseline which determines the effective
'defaults' for some options. Anything the developer sets explicitly is
an override and always wins.

Then we add a version setting to the template to point to the current
release.

This allows us to be progressive with fixing issues and improving areas
that don't work well, but offers the developer some choice about when to
adopt new behaviours. In effect, we separate new behaviours from the
libraries that develiver them. Apps can update the version, and then opt
in to new behaviours as a separate change.

* Be more american

* improve docs, add example

* Fix visibility

* Fix broken test

* Add test

* Docs!

* The rest of the tests

* fix example

* Adding docs

* PR feedback
2017-12-28 09:43:24 -08:00
Ryan Nowak 861d78fb78
Refactor content negotiation code into a service (#6998)
* Refactor content negotiation code into a service

This is a refactor in anticipation of using this logic in some other
places
2017-10-31 16:32:37 -07:00
Pranav K 41efa409a4 Remove TestOptionsManager 2017-10-30 17:49:15 -07:00
Ryan Nowak 38712609bb Design extensibility for executors
We have all of these executors but they aren't really
documented/supported for extensibility today. This change introduces a
pattern for action result executors so we can make them extensible.
2017-09-22 10:32:55 -07:00
Pranav K 7f214492b8 Introduce a filter to send bad request results with details when ModelState is invalid (#6849)
* Introduce a filter to send bad request results with details when ModelState is invalid

Fixes #6789
2017-09-21 11:09:32 -07:00
Ryan Nowak e2cb8e8ac8 A new and exciting implementation of action selection
This is an improved implementation of the ActionSelector for conventional
routing. This will do fewer dictionary lookups than the decision tree, and
will avoid OrdinalIgnoreCase hashing in the common case.
2017-05-05 17:54:09 -07:00
Pranav K 1c5e417606 Change TFM to netcoreapp2.0 (#6234)
* Change TFM to netcoreapp2.0
2017-05-04 18:11:26 -07:00
Steve Sanderson 4f351bd37c Add support for media type suffixes (#5273, #6032) 2017-03-31 10:20:43 +01:00
Pranav K badb6ce8e5 Remove net451 as a cross-compile target 2017-03-22 06:32:50 -07:00
Ajay Bhargav Baaskaran 2ffaa88830 Using NullLogger types from Logging.Abstractions 2017-03-14 12:24:18 -07:00
N. Taylor Mullen acfad83aa6 Migrate to MSBuild
- thanx to @NTaylorMullen for initial conversion
  - e.g. AssemblyInfo.cs files were already minimized or removed :)
- allow `>=` RC3 CLI's to build and run MVC
- work around several dotnet migration issues; see #5482
- disable full .NET Framework runs of functional tests; see #5873
- remove `Microsoft.DotNet.InternalAbstractions` and `System.Xml.XmlDocument` dependencies
- remove project.json (!!), *.xproj, .notest, and web.config files

Redo earlier changes:
- apply test migration to .NET 4.5.2 in *.csproj world
  - see 63507c8 for previous, project.json work
- apply dependency version downgrade from 0097e40 in *.csproj world

Make other test-related changes:
- make Microsoft.AspNetCore.Mvc.TestDiagnosticListener a regular class library
- add support for `/p:GenerateBaselines=true` for functional and Razor.Host tests
- separate `GetCSharpTypeName_ReturnsCorrectTypeNames_ForOutParameter()` test
  - work around inability to deserialize a odd `ref` type
  - xUnit and vstest now serialize / deserialze test data more often
- skip poor test mentioned in #5768
- work around Microsoft/vstest#392
  - rename tests to avoid duplicates
- work around Microsoft/vstest#419
  - set up created `AppDomain`s with current `ApplicationBase`
2017-02-28 21:20:39 -08:00
Doug Bunting 63507c8da9 Bump test projects up to .NET 4.5.2
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- update AppVeyor config so this framework version is available
- build tests for desktop .NET only on Windows
2017-02-21 07:15:36 -08:00
Joonas Westlin d44c9aee1e Added printing of route values when a route is not matched 2017-01-27 11:31:05 -08:00
Pranav K c5a5ba1fee Add support for updateable ActionDescriptorCollection
Fixes #5350
2016-11-17 10:08:38 -08:00
BrennanConroy 0a5f8e013e AppDomain safety 2016-07-27 09:26:06 -07:00
Ryan Nowak 3ed0d01eae Fix #4929 - Move IActionInvokerFactory from .Internal
Also added a wealth of doc comments to an area that's not currently super
well documented.
2016-07-05 13:18:34 -07:00
Doug Bunting 42cea41737 Fail more gracefully when option collections cleared
- #4690
- move `ModelBindingMessageProvider` init from `DefaultBindingMetadataProvider` to `DefaultModelMetadata`
 - in addition to avoiding error cases, this removes some boilerplate
- add specific errors to `BodyModelBinderProvider`, `CompilerCache`, `CompositeViewEngine`, `ModelBinderFactory`,
  and `ObjectResultExecutor`
 - `DefaultRazorViewEngineFileProviderAccessor.FileProvider` now a `NullFileProvider` in empty case
2016-06-30 14:52:50 -07:00
Derek Gray 5a3875ea72 Alter content negotiation algorithm so that it can be configured (via
MvcOptions) to always respect an explicit Accept header. Fixes #4612.
2016-06-07 16:12:36 -05:00
Ryan Nowak 2e2784aa3d [Design] Split up MvcRouteHandler
This change splits up the conventional routing path from the attribute
routing path *inside* routing, instead of inside `MvcRouteHandler`. Each
attribute route group now gets its own instance of
`MvcAttributeRouteHandler` which just knows about the actions it can
reach.

This removes the concept of a route-group-token and removes the lookup
table entirely for attribute routing. This also means that the
`DefaultHandler` on `IRouteBuilder` will not be used for attribute routes,
which we are OK with for 1.0.0.

The action selector's functionality is now split into two methods. We
think this is OK for 1.0.0 because any customization of `IActionSelector`
up to now had to implement virtually the same policy as ours in order to
work with attribute routing. It should now be possible to customize the
selector in a meaningful way without interfering with attribute routing.
2016-06-07 08:12:47 -07:00
jacalvar 6a6d2e0d9f [Fixes #4506] Move and rename ActionDescriptor.Name to ControllerActionDescriptor.ActionName 2016-05-31 23:13:20 -07:00
Ajay Bhargav Baaskaran 283573d6c9 [Fixes #4291] Simplified MvcRouteHandler code 2016-05-31 15:02:14 -07:00
Ajay Bhargav Baaskaran 3d0f436a06 [Fixes #4294] TypeActivate MvcRouteHandler 2016-05-25 12:57:16 -07:00
Ryan Nowak af58c2e6b6 Streamlining action selection and route values
Removes a few concepts we don't need
Improves documentation
More things are IDictionary instead of other random types
2016-04-22 17:36:23 -07:00
jacalvar f638c051fa Remove IAssemblyProvider and update DNX to work with application parts.
* Remove IAssemblyProvider.
* Remove DefaultAssemblyProvider in favor of DefaultAssemblyPartDiscoveryProvider.
* Update AddMvcDnx to add the list of DNX discovered assemblies to the list of application parts.
2016-04-01 11:01:09 -07:00
jacalvar 0d0aad41f5 [Fixes #4014] Add overload to AddControllerAsServices that uses the default controller discovery logic.
* Added ControllerFeature and ControllerFeatureProvider to perform controller discovery.
* Changed controller discovery to use application parts.
* Changed ControllerActionDescriptorProvider to make use of Application parts.
* Simplified AddControllerAsServices to not accept any parameter and perform
  controller discovery through the ApplicationPartManager in the IMvcBuilder
  and IMvcCoreBuilder. Assemblies should be added to the ApplicationPartManager
  in order to discover controllers in them.
2016-04-01 09:29:37 -07:00
Doug Bunting 6bf25cecec React to HttpAbstractions namespace changes
- aspnet/HttpAbstractions#549 and aspnet/HttpAbstractions#592
- clean up `using`s
2016-03-30 16:19:42 -07:00
Pranav K 12d7093278 Revert "Remove DependencyModel dependency"
This reverts commit 4299a4d50b.
2016-03-29 07:29:43 -07:00
Pranav K 4299a4d50b Remove DependencyModel dependency 2016-03-16 16:05:04 -07:00
Pranav K 5a7267a83d Revive DefaultAssemblyProviderTests
Partial fix for https://github.com/aspnet/Mvc/issues/4140
2016-03-07 17:01:58 -08:00
Pranav K 80b6996701 * Moving DNX dependencies to test only
* Updating Mvc tests to use dotnet test to run on dnxcore50
2016-02-23 18:58:42 -08:00
Pranav K 5b805bb12d Updating to use cli
Fixes #3908
2016-02-22 17:49:51 -08:00
jacalvar 65858b8d8b [Fixes #4051] Split OutputFormatter into OutputFormatter and TextOutputFormatter 2016-02-12 12:04:18 -08:00
ryanbrandenburg 78e7179221 * Remove HttpRespomseStreamWriter 2016-01-27 16:04:54 -08:00
Pavel Krymets 79eb0138c7 Migrate to using System.Runtime.Loader.AssemblyLoadContext 2016-01-26 10:22:25 -08:00
N. Taylor Mullen 3be7fbdf9f Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:18:33 -08:00
N. Taylor Mullen 6a6c8ca544 Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:17:07 -08:00