Skip to content

Support for Comparison of fields. #5

Description

@jeme

In some cases, validation of one field depends on another field in a non-static way.

E.g.

$updated must be greater than or equal to $created.

We should be able to introduce this to the framework without having to change the entire framework if we choose a syntax as:

When("$updated", Is.Defined()).Then(Field("$updated", ComparedTo("$created", b => Must.Be.GreaterOrEqualTo((DateTime)b))));

//Alternate syntax: (CompareTo over ComparedTo).
When("$updated", Is.Defined()).Then(Field("$updated", CompareTo("$created", ... 

One issue here is the descriptors, they need to be able to describe the lazy constraint.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions