using Deltares.Dam.Data; namespace Deltares.Standard.Specifications { public class NotSpecification : CompositeSpecification { private readonly ISpecification specification; public NotSpecification(ISpecification specification) { this.specification = specification; } /// /// Determines whether the candidate satisfies the specification. /// /// The candidate to test. /// /// true if the candidate satisfies the specification otherwise, false. /// public override bool IsSatisfiedBy(TCandidate candidate) { bool satisfied = !(this.specification.IsSatisfiedBy(candidate)); if (!satisfied) { base.Description = this.specification.Description; } return satisfied; } } }