Skip to content

AreNotReadOnly and AreReadOnly share the same implementation #370

Open
@martin-hirsch

Description

@martin-hirsch

As long as there is no magic around these predicates, my guess is that we could change AreNotReadOnly to member.Writability != Writability.ReadOnly. Any objections? (version 0.11.4)

        public static IPredicate<T> AreReadOnly()
        {
            return new SimplePredicate<T>(
                member => member.Writability == Writability.ReadOnly,
                "are read only"
            );
        }
        public static IPredicate<T> AreNotReadOnly()
        {
            return new SimplePredicate<T>(
                member => member.Writability == Writability.ReadOnly, // <-- Change to !=
                "are not read only"
            );
        }

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions