Commit Graph

1046 Commits

Author SHA1 Message Date
Ryan Nowak 7c961e3ce8 TODO removal
For each of these TODOs:

- If there's an active bug tracking the work, and the TODO provides
  something of value, I left it and standardized the formatting. I also
  added comments to the bug.

- If the comment provided no value (implement feature X when we do feature
  X), I deleted it with impunity.

- If the comment was stale (won't fix or just out of date), then we
  removed it uncerimoniously.

There was a single TODO that was actually actionable, so I enabled that
test.
2014-11-20 15:01:35 -08:00
Pranav K 8a668eb9d1 Adding unit tests for HtmlHelper.Password
Partial fix for #453
2014-11-20 12:12:29 -08:00
N. Taylor Mullen 35982b3049 React to aspnet/Razor#210 changes. 2014-11-20 11:54:18 -08:00
Ryan Nowak 1563700feb Fix for #1539 - We're not going to do anything special when request
services aren't enabled

This is just removing the TODO.
2014-11-20 11:14:01 -08:00
N. Taylor Mullen 9c4d5dcf5c React to aspnet/Razor#214 mvchook changes. 2014-11-20 10:45:37 -08:00
NTaylorMullen 1cf6607e75 React to aspnet/Razor#214 changes.
- TagHelperAttributeDescriptors changed to be lighterweight and not depend on PropertyInfo, had to modify our use of them to work with the new contract.
2014-11-20 10:27:33 -08:00
Doug Bunting 10f7234c61 Add more tests of `<input/>` tag helper
- scenarios where helper takes different code paths were not well-explored

nits:
- improve a few comments and names
- refactor some setup code into helper methods
- use `EmptyModelMetadataProvider`, not `DataAnnotationsModelMetadataProvider`

Test gap around `GenerateTextBox()`'s `format` argument is temporary.
2014-11-19 22:36:48 -08:00
Doug Bunting 6c4b1398b8 Address small `InputTagHelper` bug discovered while testing
- Type attribute value was "Type", not "type", when determined from template hints

nit: remove useless condition
2014-11-19 22:36:41 -08:00
Doug Bunting 1b28e19114 MVC tag helpers should not override tag name in Razor source
- #1523
- remove `TagHelperOutput.Merge()` extension method entirely
- test tag name preservation with all MVC tag helpers
 - `<input/>` tag helper generation of a checkbox wasn't previously tested

nits:
- fix argument order in a couple of `Assert.Equal()` calls
- remove use of "original tag name"
2014-11-19 22:35:31 -08:00
Ryan Nowak 99a1848598 Checkin VS modifications to kproj
My up-to-date VS wants these projects to have port numbers. Makes sense
because they are web projects.
2014-11-19 16:11:46 -08:00
Ryan Nowak ed8ba5ae9c Fix for #1194 - Error using [HttpPost] and [Route] together
This change enables some compatibility scenarios with MVC 5 by expanding
the set of legal ways to configure attribute routing. Most promiently, the
following example is now legal:

[HttpPost]
[Route("Products")]
public void MyAction() { }

This will define a single action that accepts POST on route "Products".

See the comments in #1194 for a more detailed description of what changed
with more examples.
2014-11-19 15:52:20 -08:00
Ajay Bhargav Baaskaran e21f157095 changed contract.assert to debug.assert 2014-11-19 15:35:28 -08:00
ianhong f470fa6d74 Merge branch 'actionmodel1495c' into dev 2014-11-18 16:59:01 -08:00
Pranav K a322588af6 Reacting to DataProtectionServices being removed from hosting services 2014-11-18 15:49:12 -08:00
ianhong 59b7352e8e Update per comment 2014-11-18 15:35:40 -08:00
ianhong 7b58d569eb ReadOnly attributes for Action, Controller, and Parameter 2014-11-18 15:35:39 -08:00
Ryan Nowak 38b3b61485 update due to breaking changes in routing 2014-11-18 12:37:47 -08:00
Ryan Nowak 661583f694 Fix for #1447 - Adding functional tests that verify per-request services
These tests verify that per-request services can be injected into assets
that users provide/implements (filters, constraints, controllers, views,
etc).

The purpose is to verify that the services are correctly resolved from the
per-request service container, and don't have state that lingers and
influences the next request. This is important because changing the
lifetime of a framework services could easily impact the lifetimes of
others, and ultimately of something the user created.
2014-11-17 18:38:49 -08:00
Ryan Nowak ca92700a6f Adding a functional test that modifies data tokens
Tracked by aspnet/Routing#116

The product support for this feature is in already this change just adds a
test verifying the scenario.
2014-11-17 18:35:04 -08:00
Ryan Nowak 5fd453f07d Revert "Fix for MVC #1539 - Deal with the case where request services are not set"
This reverts commit d9a3c265ea.

This was the wrong commit, did not intent to merge this.
2014-11-17 18:33:56 -08:00
Ryan Nowak d9a3c265ea Fix for MVC #1539 - Deal with the case where request services are not set
Rather than throwing here, this does what routing does. If request
services aren't set, we just create our own scope.

This will NOT create an extra scope if request services are already set.
2014-11-17 17:30:41 -08:00
ianhong 57d234bd7b Removing a <inheritdoc> comment that I forgot from the previous push. 2014-11-14 15:22:36 -08:00
Pranav K 052ad3e95f RenderSection \ RenderSectionAsync does not work in sections
Fixes #1509
2014-11-14 12:17:25 -08:00
ianhong dd1500dcfb Updated a comment and sort usings 2014-11-13 11:28:13 -08:00
ianhong 245d1dffda Updating the summary comment for IRazorViewFactory and its tests per comments 2014-11-13 11:28:12 -08:00
ianhong 0720177243 Updating per comments 2014-11-13 11:28:12 -08:00
ianhong 23a7aa813d Updating FindView_UsesViewLocationExpandersToLocateViews for IRazorViewFactory. 2014-11-13 11:28:12 -08:00
ianhong e9c7a34cfc Introducing RazorViewFactory for RazorView 2014-11-13 11:28:11 -08:00
Doug Bunting 7e8870cb9f Per PR discussion
- clean up "the the" in XML comments
- simplify refactoring VS did when I renamed `GetHtmlHelperForViewData()`
 - fix existing issue in `HtmlHelperCheckboxTest.CheckBoxReplacesUnderscoresInHtmlAttributesWithDashes()`
   (was using a `HtmlHelper<ViewDataDictionary<TestModel>>`)
2014-11-12 21:56:11 -08:00
Doug Bunting 1d3ae83507 Address PR comments in test code
- add missing license headers
- make "post" more obvious
- use `Assert.IsAssignableFrom()`

nit: remove unused `using`s in `HtmlHelperLinkGenerationTest`
2014-11-12 21:56:03 -08:00
Doug Bunting 6313a9682e Address PR comments in product code
- XML comment improvements
2014-11-12 21:55:55 -08:00
Doug Bunting 2982c72547 Add `Html.BeginForm()` and `Html.BeginRouteForm()` tests
- helps w/ #453 since `Html.BeginForm()` wasn't previously tested
- provide a `DefaultTemplatesUtilities.GetHtmlHelper()` overload with an
  `IHtmlGenerator` parameter
- update `DefaultTemplateUtilities` to use `DefaultHttpContext`
 - stop using a mock for this purpose; provides a non-`null` `Request`

nit:
- `DefaultTemplatesUtilities.GetHtmlHelperForViewData()` -> `...GetHtmlHelper()`
  for consistency with other overloads
2014-11-12 21:55:48 -08:00
Doug Bunting 22fafe298c Add `BeginRouteForm()` HTML helper
- refactor `DefaultHtmlGenerator.GenerateForm()` to support new method

nits:
- correct XML comments
- add a few more code comments
2014-11-12 21:55:40 -08:00
kanchanm 47d0afbe38 Fixing xml comment typo 2014-11-12 16:25:01 -08:00
kanchanm 4598505652 Fix to special case Dispose method to be treated as non-action 2014-11-12 14:52:19 -08:00
Ryan Nowak e9d8c845d6 Create a new routedata for each 'router' for MVC
This is the MVC companion to https://github.com/aspnet/Routing/pull/122

As routing flows, routes replace the route data and mutate a copy. This
allows users to make changes that dirty the data without affecting
undesired state changes.

We also add the 'next' router for diagnostic purposes.
2014-11-12 11:10:21 -08:00
Ajay Bhargav Baaskaran 232deb47d0 added tests for json input formatter 2014-11-12 10:50:55 -08:00
Kiran Challa 17e4dd2bf6 [Fixes #1429] Content negotiation does a case-sensitive matching of media type's parameter values 2014-11-11 10:15:51 -08:00
Doug Bunting 2d32420f01 Add `<option/>` tag helper
- #1423
2014-11-07 14:11:12 -08:00
Doug Bunting 30f25fec99 Provide selected values to `<option/>` tag helpers
- value may remain in the `FormContext` beyond `</select>` end tag but will
  be cleaned up at the `</form>` end tag of the containing `<form/>` element
 - `SelectTagHelper` called prior to helpers for contained `<option/>`s and
   not again later
- adjust mock setups to handle new `GenerateSelect()` call
- add assertions for expected `FormContext.FormData` entry

nit: mention #1468 in a test comment
2014-11-07 14:11:07 -08:00
Doug Bunting 3d84b528e5 Extend `IHtmlGenerator.GenerateSelect()` to make selected values available
nit: use Linq methods, not query syntax in `DefaultHtmlGenerator`
2014-11-07 14:10:26 -08:00
N. Taylor Mullen de9a999bf6 React to aspnet/Razor#208 changes. 2014-11-07 11:54:30 -08:00
Pranav K 970ee1b71f Fixing dev NuGet.config 2014-11-06 22:08:10 -08:00
Pranav K d5145edffe Merge branch 'release' into dev 2014-11-06 12:21:21 -08:00
Pranav K ed64922499 Updating to release NuGet.config 2014-11-06 12:21:03 -08:00
Harsh Gupta 6b2f331e8d Adding support for excluding types for validation, based on type names for body bound models. 2014-11-06 11:00:50 -08:00
Pranav K bff70e0dd1 Merge branch 'release' into dev 2014-11-06 10:49:13 -08:00
Pranav K 860d81068c Updating to release NuGet.config 2014-11-06 10:49:11 -08:00
SonjaKhan 27e0323a8a renaming TraceType to LogLevel 2014-11-06 09:24:02 -08:00
Doug Bunting 687b174b63 Accept VS changes to avoid noise later 2014-11-04 22:42:51 -08:00