// OCHamcrest by Jon Reid, https://qualitycoding.org/ // Copyright 2019 hamcrest.org. See LICENSE.txt #import "HCIsNot.h" #import "HCWrapInMatcher.h" @interface HCIsNot () @property (nonatomic, strong, readonly) id matcher; @end @implementation HCIsNot - (instancetype)initWithMatcher:(id )matcher { self = [super init]; if (self) _matcher = matcher; return self; } - (BOOL)matches:(nullable id)item { return ![self.matcher matches:item]; } - (void)describeTo:(id )description { [[description appendText:@"not "] appendDescriptionOf:self.matcher]; } - (void)describeMismatchOf:(nullable id)item to:(nullable id )mismatchDescription { [self.matcher describeMismatchOf:item to:mismatchDescription]; } @end id HC_isNot(_Nullable id value) { return [[HCIsNot alloc] initWithMatcher:HCWrapInMatcher(value)]; }