Skip to content

Value types with low variability aren't able to use value-based constraints #1

@martaver

Description

@martaver

For every other value, such as int or a reference type, the uniquely generated placeholder value is used to look up a constraint definition. This works, because for reference types each placeholder value is truly unique and integers have enough variability that collisions from random number generation can be reasonably minimized.

For value types like bool and byte, however, this is not the case. In the case of bool, we only have two values available to us, true or false, so collisions are inevitable.

How can we get around this and allow bool values (and other low variability value types) to take advantage of ShouldBe constraints?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions