Commit Graph

59 Commits

Author SHA1 Message Date
Pranav K a834928f1a Change IsValid method in ModelStateDictionary to GetValidationState
Fixes #400
2014-05-21 19:33:36 -07:00
Pranav K a53e378cf4 Updating kproj file to match tooling changes 2014-05-18 20:13:56 -07:00
Andrew Peters f13865dedc Updating copyright headers 2014-05-08 23:01:20 -07:00
Wei Wang 7b2feab670 Sort dependencies and remove duplicates in dependencies 2014-05-07 18:24:04 -07:00
Pranav K 4566947e33 Change ModelState.IsValid back to bool 2014-05-07 17:41:47 -07:00
lajones 235707ec8a Microsoft.ComponentModel.DataAnnotations is being renamed to Microsoft.DataAnnotations 2014-05-07 13:35:36 -07:00
Pranav K 904c91d2b9 CompositeModelBinder should only validate the object graph at the top
level.
DataAnnotationsModelValidator should prefer the container to Metadata.Model

Fixes #247
2014-05-06 17:39:50 -07:00
Pranav K 076dedcca5 Reacting to package and namespace changes 2014-05-06 14:06:29 -07:00
Ryan Nowak abbaa11212 Incorporate name changes: HttpAbstractions 2014-05-05 17:14:08 -07:00
Ryan Nowak 4ece9969bf HttpAbstractions 2014-05-05 16:29:14 -07:00
Louis DeJardin bbcac43aaa Updating DataAnnotations version reference 2014-05-02 20:53:12 -07:00
dougbu 392aa464b2 Oops wrong test 2014-05-01 19:22:16 -07:00
dougbu a2ba36498a TEMPORARILY disable ClientRulesWithCompareAttribute_ErrorMessageUsesOverride
- test failing under CoreCLR
- leave it running under .NET 4.5
2014-05-01 19:12:23 -07:00
dougbu 222c763b72 Revert "Correcting WebFx failure on CI machines"
- previous attempt didn't work

This reverts commit a626896b80.
2014-05-01 19:08:37 -07:00
dougbu a626896b80 Correcting WebFx failure on CI machines
- a single test is failing under CoreCLR only
- using the resource-related properties of a `ValidationAttribute` in
  precisely one place – the failing test.
- in .NET the DataAnnotations assembly is somehow able to get access to
  `internal` resources
- that doesn’t work under CoreCLR
- short-term fix is to add an `[InternalsVisibleTo]` in the test
  assembly, giving DataAnnotations access to the resource

Will also file a bug in the DataAnnotations repo
2014-05-01 19:01:53 -07:00
anpete 8208cd6b2f Update file headers 2014-05-01 17:42:33 -07:00
Ryan Nowak 20c8dece7b Adding IFilterFactory
This is a generalized factory/provider for filters - TypeFilterAttribute
and ServiceFilterAttribute are now implemented in terms of this interface.
2014-04-30 13:18:10 -07:00
sornaks d63d998e95 Introducing DisplayText, DisplayTextFor, Id, IdFor, IdForModel.
Fixing CachedDataAnnotationsModelMetadata to support NullDisplayText.
2014-04-30 10:23:25 -07:00
Pranav K f740aabb79 Reviving RangeAttributeAdapter, RequiredAttributeAdapter,
StringLengthAttributeAdapter

* Adding remaining DataTypeAttribute adapter rules
2014-04-26 11:39:29 -07:00
Pranav K f5ba63ea1e Fixing missing files in kproj
Fixing typo in sample filter
2014-04-25 14:48:14 -07:00
Pranav K d61915149c DictionaryBasedValueProvider results null when value is not found
* Guard against Dictionary returning null values
2014-04-24 18:10:06 -07:00
Pranav K 2ba8780ee0 Reviving MinLength and MaxLength attribute adapters 2014-04-24 15:52:05 -07:00
Pranav K b0c7dc9220 Make IModelBinder and IValueProvider methods async 2014-04-24 15:16:27 -07:00
Pranav K 3671e8c5b4 Reviving CompareAttributeAdapter and ModelClientValidationEqualToRule 2014-04-22 23:11:24 -07:00
Pranav K cc00d8cff7 Modify TypeConverterModelBinder to use ValueProviderResult.CanConvertFromString to determine if it can convert a
value

* Adding support for extra type conversions
2014-04-22 23:00:58 -07:00
David Fowler 40d9fa0019 Added missing dependency 2014-04-21 22:59:26 -07:00
Ryan Nowak 40e7fcc9ba Turning on warnings as errors 2014-04-16 20:21:07 -07:00
dougbu 0e7dff9ca7 Get CoreCLR test builds compiling again
- no Mock without .NET 4.5
- reverts part of "Reviving support for IValidatableObject in CoreCLR"
- that was commit 0f6df5405b.
2014-04-12 13:45:11 -07:00
Pranav K 0f6df5405b Reviving support for IValidatableObject in CoreCLR 2014-04-10 22:09:57 -07:00
dougbu 0d9c052e43 Restore ability to run some tests using CoreCLR
- revert part of "Made a few more changes since we have new tooling"
- was commit b1fd5cc689
2014-04-10 17:15:17 -07:00
dougbu ba08f8e8d8 Cleanup Display, Partial, and Validation extensions
- correct file and class names for some HH extensions
 - three class names were correct but didn't match containing file
 - three class and file names matched but didn't start with HtmlHelper
- clean up trailing whitespace and long lines in changed Extensions.cs files
 - `HtmlHelperPartialAsyncExtensions`, `HtmlHelperRenderPartialAsyncExtensions`
   and `HtmlHelperValidationExtensions` lacked some `[NotNull]` attributes
- merge extension files by concept
 - Display / DisplayFor / DisplayForModel methods all into `HtmlHelperDisplayExtensions`
 - Partial / RenderPartial methods all into `HtmlHelperPartialExtensions`
- use `IHtmlHelper<TModel>` everywhere
2014-04-10 17:12:16 -07:00
Ryan Nowak 408d4056b1 Rearrange ViewContext 2014-04-10 11:40:57 -07:00
David Fowler b1fd5cc689 Made a few more changes since we have new tooling
- Remove runtime interface declarations and use
  Microsoft.Net.Runtime.Interfaces package
- Made tests compile for net45 and made default
  intellisense view net45 for unit tests since Moq
  doesn't work
2014-04-09 12:24:16 -07:00
David Fowler a970fa04ab Updated to use the new tooling 2014-04-09 12:24:16 -07:00
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
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
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
Pranav K f1c4a8e497 Change FormValueProviderFactory to use GetContentType for media type matching
Fixes #68
2014-03-21 12:10:12 -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
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 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