DDSMocking.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Software License Agreement (BSD License)
  2. //
  3. // Copyright (c) 2010-2025, Deusty, LLC
  4. // All rights reserved.
  5. //
  6. // Redistribution and use of this software in source and binary forms,
  7. // with or without modification, are permitted provided that the following conditions are met:
  8. //
  9. // * Redistributions of source code must retain the above copyright notice,
  10. // this list of conditions and the following disclaimer.
  11. //
  12. // * Neither the name of Deusty nor the names of its contributors may be used
  13. // to endorse or promote products derived from this software without specific
  14. // prior written permission of Deusty, LLC.
  15. @import Foundation;
  16. NS_ASSUME_NONNULL_BEGIN
  17. @interface DDSMocking: NSObject
  18. @end
  19. NS_ASSUME_NONNULL_END
  20. @interface DDBasicMockArgument: NSObject
  21. @property (copy, nonatomic, readwrite) void(^block)(id object);
  22. + (instancetype)alongsideWithBlock:(void(^)(id object))block;
  23. @end
  24. @interface DDBasicMockArgumentPosition: NSObject <NSCopying>
  25. @property (copy, nonatomic, readwrite) NSString *selector;
  26. @property (copy, nonatomic, readwrite) NSNumber *position;
  27. - (instancetype)initWithSelector:(NSString *)selector position:(NSNumber *)position;
  28. @end
  29. @interface DDBasicMock<T>: NSProxy
  30. + (instancetype)decoratedInstance:(T)object;
  31. - (instancetype)enableStub;
  32. - (instancetype)disableStub;
  33. - (void)addArgument:(DDBasicMockArgument *)argument forSelector:(SEL)selector atIndex:(NSInteger)index;
  34. @end