ArchUnitNET icon indicating copy to clipboard operation
ArchUnitNET copied to clipboard

AreNotReadOnly and AreReadOnly share the same implementation

Open martin-hirsch opened this issue 6 months ago • 0 comments

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"
            );
        }

martin-hirsch avatar May 28 '25 11:05 martin-hirsch