Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

Edited Issue: Issues in ShouldHaveValidationErrorFor and ShouldNotHaveValidationErrorFor methods [7095]

$
0
0
We cannot use ShouldHaveValidationErrorFor and ShouldNotHaveValidationErrorFor methods for nested properties. For example, for tested class has a property of another class. For example, we cannot write:
validator.ShouldHaveValidationErrorFor(x => x.AddNewComment.CommentText, model);
(an exception is thrown)

For more info please get the latest development version of nopCommerce (open source shopping cart). It's not an official release yet, so get it here http://nopcommerce.codeplex.com/SourceControl/list/changesets . Open Nop.Web.MVC.Tests project, then \Public\Validators\Blogs\BlogPostValidatorTests.cs unit test file. Look at its implementation

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>