Ignored fields are still validated

18 views
Skip to first unread message

Rémi BOURGAREL

unread,
Jan 26, 2012, 8:01:05 AM1/26/12
to castle-pro...@googlegroups.com
If we specify some fields to ignore they are still getting validated.

The following test fails


        [Test]
        public void IgnoredFieldsNotValidated()
        {
            var args = new NameValueCollection { { "person.Email", string.Empty }};
            object instance = binder.BindObject(typeof(Person), "person","person.Email",null, builder.BuildSourceNode(args));

            Assert.IsNotNull(instance);
            Assert.AreEqual(0, binder.ErrorList.Count);
        }

  Expected: 0
  But was:  1


The best solutions would be to add a call to ShouldIgnoreProperty in the function CheckForValidationFailures, the validation will still be done but it won't be added to the error list. Because it seems that it will be too muche complicated to add the ignored properties list to the validation interface (IValidatorRunner and IValidatorPerformer).

no ?
 




 

hammett

unread,
Jan 26, 2012, 2:36:38 PM1/26/12
to castle-pro...@googlegroups.com
Patch? :-)

2012/1/26 Rémi BOURGAREL <bourgar...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Development List" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/castle-project-devel/-/Oks1eu7Ehi8J.
> To post to this group, send email to castle-pro...@googlegroups.com.
> To unsubscribe from this group, send email to
> castle-project-d...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/castle-project-devel?hl=en.

--
Cheers,
hammett
http://hammett.castleproject.org/

Rémi BOURGAREL

unread,
Jan 27, 2012, 6:07:03 AM1/27/12
to castle-pro...@googlegroups.com
I'm fighting with git (I'm just know the svn way of doing things) and I'll add it to my fork... (I could use the castle.monorail gitwith tortoisesvn but I can't with castle.core, that's odd)

Rémi
Rémi BOURGAREL
Téléphone : +336 49 16 78 57
Adresse : 82 Rue Matabiau , 31 000 Toulouse, France

Rémi BOURGAREL

unread,
Jan 27, 2012, 8:33:30 AM1/27/12
to castle-pro...@googlegroups.com
I commited it to my fork https://github.com/RemiBou/Core

I had to change a few private method's signature.

Unit Tests are OK.

Rémi

G. Richard Bellamy

unread,
Jan 27, 2012, 10:07:33 AM1/27/12
to castle-pro...@googlegroups.com, Rémi BOURGAREL
Rémi,

Thanks for the work.

Did you mean TortoiseGit rather than TortoiseSvn?

Make sure you use Tabs rather than spaces. And then, once you've cleaned up the formatting, go ahead and create a GitHub pull request.

-rb

Rémi BOURGAREL

unread,
Feb 6, 2012, 4:19:20 AM2/6/12
to castle-pro...@googlegroups.com, Rémi BOURGAREL

hammett

unread,
Feb 6, 2012, 2:36:20 PM2/6/12
to castle-pro...@googlegroups.com
Yup. Could you send a PR?

2012/2/6 Rémi BOURGAREL <bourgar...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups
> "Castle Project Development List" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/castle-project-devel/-/ncpFtptCk10J.

Rémi BOURGAREL

unread,
Feb 7, 2012, 4:00:35 AM2/7/12
to castle-pro...@googlegroups.com
Done ! (right ?)
Reply all
Reply to author
Forward
0 new messages