Commit Graph

2799 Commits

Author SHA1 Message Date
Pranav K c8ede78582 Expanding ValueProviderResult to support more data types
* Reviving tests for ValueProviderResult
2014-04-09 09:33:29 -07:00
Pranav K ea3e958563 Adding unit tests for CompositeModelBinder 2014-04-08 18:48:01 -07:00
dougbu 4feb8f4f28 Remove reduncant `ArgumentNullOrEmpty` resource from Core project
- came from Rendering but Core already had `ArgumentCannotBeNullOrEmpty`
- moved wording from "argument must not be" to "value cannot be"

Also make similar resources consistent in this repo
- adjust Razor's `ArgumentCannotBeNullOrEmpty` resource to use same wording
  as Core, adding "The"
- update ModelBinding to also have `ArgumentCannotBeNullOrEmpty` and to use
  it consistently with Core and Razor
2014-04-08 12:03:50 -07:00
Sornakumar b25091f6c1 Merge branch 'WebFX156' into dev 2014-04-08 10:52:38 -07:00
sornaks 7c8dd45b8b WebFX 156 - Adding support for Redirect and RedirectPermanent 2014-04-08 10:49:56 -07:00
harshgMSFT 01527cd4df Adding HttpPost, HttpDelete, HttpPut, HttpPatch attributes 2014-04-07 22:31:48 -07:00
Ryan Nowak faa8251b70 Merging Mvc.Rendering and Mvc.Core 2014-04-07 17:32:49 -07:00
harshgMSFT 652e89b343 Adding HttpGetAttribute and AcceptVerbsAttribute.
HttpPost, HttpDelete, HttpPut and HttpPatch would be similar.
Also adding few tests.
2014-04-07 15:10:22 -07:00
Ryan Nowak df16982697 Adding and updating old propertyhelper code for dictionaries 2014-04-07 14:41:24 -07:00
Ryan Nowak ec4b3a29c0 Adding smart link generation
This feature will enforce a contract that link generation has to point to
a real action. Read the comments in code for more details and rationale.
2014-04-07 14:37:52 -07:00
Pranav K 931d18b851 Adding exceptions for RenderSection, DefineSection and RenderBody 2014-04-07 12:25:44 -07:00
Pranav K 94c028a5df Adding support for RazorView.IsSectionDefined 2014-04-06 17:18:37 -07:00
Pranav K fc01cf6eea Fixing typo in DefaultAssemblyControllerProvider 2014-04-04 16:29:16 -07:00
Pranav K 9291cbc50b Adding support for RenderSection
* Adding unit tests for DefineSection \ RenderSection
* Changes per code review feedback
2014-04-03 15:00:06 -07:00
Pranav K 75dae948b2 Change IViewEngine.FindView to be synchronous 2014-04-03 14:20:39 -07:00
Pranav K 2e0bed750e Adding support for Url.Content, Href and ~/ in Razor views 2014-04-03 14:12:55 -07:00
Yishai Galatzer ebd54bfc06 Dispose controllers after they have been utilized by the action invoker 2014-04-03 09:31:23 -07:00
Ryan Nowak 1b4754454b Relayering MVC Dependencies Part 1/N
Merging Mvc.Razor.Host into Mvc.Razor
2014-04-02 18:28:34 -07:00
harshgMSFT 8d4a6c760a Action Selection Convention: Changes for Treating Index method as a default Get/Post method.
Also adds unit tests for the changes.
2014-03-31 12:59:30 -07:00
Pranav K c72c80c101 Add the ability to correctly determine if a particular field has been validated.
There are several portions of model validation that attempt to avoid
revalidating if a field has been validated. However the behavior of
ModelStateDictionary makes it difficult to distinguish between an
unvalidated field and a field without validation errors. This change
resolves this issue by letting the caller distinguish between the two
cases.
2014-03-31 12:40:38 -07:00
dougbu 655b329dd0 Increment System.Threading.Tasks package version
- today's build break, mark II

also remove dangling reference to TestCommon
2014-03-27 19:56:27 -07:00
Pranav K cb21c34770 Reintroduce ModelStateDictionaryTest 2014-03-26 17:32:45 -07:00
dougbu 8ed5b7b079 Fix WebFx-169 and #118
- move `DynamicObject` derivation up to new `DynamicViewData` class, fixing [WebFx-169](http://projectk-tc:8080/browse/WEBFX-169)
- avoid direct `_data` lookup in previous `TryGetMember()`, fixing [#118](https://github.com/aspnet/WebFx/issues/118)
- rename ViewData -> ViewDataDictionary

Also
- flesh out `IDictionary<string, object>` implementation in `ViewData`
- provide `ViewData` copy constructor that allows TModel to change
- remove `TryGetIndex()` and `TrySetIndex()` implementations; use `ViewData[]` instead
- restore `ViewContext.ViewBag` from legacy MVC
2014-03-26 11:42:52 -07:00
Pranav K af7d61113b Updating test projects to use Microsoft.AspNet.Testing 2014-03-25 15:10:58 -07:00
Pranav K a2cea18529 Replacing argument not null checks in ModelBinding with NotNullAttribute
* Removing not null guard tests in ModelBinding
2014-03-25 12:35:33 -07:00
Ryan Nowak 86ac978451 Implementation of ViewComponents 2014-03-25 11:04:37 -07:00
dougbu 32d031c6eb Add `ModelMetadata` to `ViewData`
- demonstrate `ModelMetadata` is available in a view

Also
- simplify `View()` overloads in `Controller`, pending #110 decisions
- make `Model` in `RazorView<T>` readonly
2014-03-21 14:42:42 -07:00
Pranav K 857a239990 Making Moq version in Mvc.Core.Test consistent with all other test projects 2014-03-21 14:11:49 -07:00
Pranav K f1c4a8e497 Change FormValueProviderFactory to use GetContentType for media type matching
Fixes #68
2014-03-21 12:10:12 -07:00
Pranav K 8ea196023e Modify controller discovery to only look for types that reference Mvc.Core
assembly
2014-03-21 10:02:54 -07:00
Pranav K 683c5bf9b3 Adding JsonInputFormatter for reading json encoded data from the request
body
2014-03-20 20:48:25 -07:00
Pranav K f8dd52dfe3 Reintroducing BindingBehaviorAttribute attribute
* Porting MutableObjectModelBinder tests
* Fix issues in MutableObjectModelBinder introduced by changing from
  TypeDescriptors to reflection
2014-03-19 16:52:02 -07:00
harshgMSFT 9cd99a42a7 ActionExecutor implementation WebFx W113
The changes include:
1. Action executor changes required for supporting sync and async operations Taksk and Task
2. Adding test project for MVC core - This contains ActionExecutor Tests.
3. Also adding a resources file for MVC core project
2014-03-19 11:10:42 -07:00
dougbu 4bc7c36522 Merge two `TypeExtensions` classes into Common\TypeExtensions.cs
- add missing `[NotNull]` attributes
- remove now-unneeded usings for ...ModelBinding.Internal namespace

Also get ModelBinding test project working under CoreCLR
- create separate k10 and net45 folders under test in VS
- add `[InternalsVisibleTo]` to make `TypeExtensions` visible to test assembly
- correct tests' `CultureInfo` use to compile under CoreCLR
- ifdef out CoreCLR tests depending on Moq, ReadOnly, ...
- remove a couple of tests expecting TypeConverter to work
2014-03-19 09:53:40 -07:00
Pranav K 072e2cc1f1 Updating DataAnnotations version in project.json 2014-03-18 20:56:08 -07:00
dougbu 3a0add8be8 Cleanup pass: Move Rendering classes to correct namespace
- use Microsoft.AspNet.Mvc.Rendering namespace throughout assembly

Also
- move `IdAttributeDotReplacement` from `TagBuilder` to `HtmlHelper`
- remove commented-out code in `HtmlHelper`
- use `var` and `[NotNull]` more
- `String` -> `string`
- correct Resources references; add missing resources
2014-03-18 14:02:39 -07:00
dougbu 478c220ddb Revert "Merge two `TypeExtensions` classes into Common\TypeExtensions.cs"
This reverts commit d534471515.
2014-03-17 22:53:36 -07:00
dougbu d534471515 Merge two `TypeExtensions` classes into Common\TypeExtensions.cs
- add missing `[NotNull]` attributes
- remove now-unneeded usings for ...ModelBinding.Internal namespace
- remove TypeExtensionTests.cs; don't add .NET 4.5-only
  `[InternalsVisibleTo]` for low-level `IsCompatibleWith()` extension
2014-03-17 21:02:25 -07:00
dougbu ed1b2ddcc3 Run unit tests during builds
- add "test" command
- use latest (forked) XUnit packages
  update package references
  [PropertyData] -> [MemberData]
  Xunit.Extensions -> Xunit or Xunit.SDK
  Moq now available for .NET 4.5 only
- delete a couple of unit tests checking for ArgumentNullException
- provide TestCommon classes in Razor and Razor.Host test projects
- make ReplaceCulture internal because it's a shared source
2014-03-17 16:28:25 -07:00
Pranav K e434918337 Reintroduce model validation 2014-03-12 21:55:50 -07:00
Pranav K 9132d32fa4 Renaming IsCompatibleObject to IsCompatibleWith to match definition 2014-03-10 17:14:35 -07:00
Ryan Nowak 86f18f5da7 Moving ViewContext to rendering, breaking coupling to RequestContext 2014-03-10 16:15:46 -07:00
Pranav K 07974b44e2 Adding unit tests for TypeExtensions.IsCompatibleObject 2014-03-10 16:09:02 -07:00
dougbu 59eaa8f642 Fix 4 unit test failures
- NRE in TypeExtensions.IsCompatibleWith()
- ComplexModelDtoResultTest.Constructor_ThrowsIfValidationNodeIsNull() won't work w/o validation
- BindModel_Error_FormatExceptionsTurnedIntoStringsInModelState() looking for wrong message
- BindModel_Error_FormatExceptionsTurnedIntoStringsInModelState_ErrorNotAddedIfCallbackReturnsNull() a dupe
- Also add [NotNull] attributes in TypeExtensions
2014-03-10 12:27:32 -07:00
Pranav K 123089d5c7 General razor clean up
* Change Razor compilation to use ApplicationBasePath to determine the
  app root
* Change class name generation to be based on app-relative path.
2014-03-10 11:56:07 -07:00
Pranav K d920003194 Introduce FormValueProviderFactory to expose form data as a value provider 2014-02-28 11:05:39 -08:00
Pranav K b6c78de4ea Reintroduce model binding 2014-02-23 15:23:58 -08:00
Pranav K 5a22d9b52c Restore @model support in RazorHost 2014-02-13 12:48:02 -08:00
Pranav K b51fd08bab Update ViewDataOfT.SetModel to check for type compatibility when setting
model instance.
2014-02-05 14:33:11 -08:00