Skip to content

Support for Comparison of fields. #5

@jeme

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.

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