Browse Source

IOSAD-191 Delete PEPAttachmentTest.

IOSAD-191
David Alarcon 1 year ago
parent
commit
6bac5407e3
4 changed files with 25 additions and 75 deletions
  1. +0
    -17
      PEPObjCAdapterTypesTests/Mocks/PEPAttachmentTest.h
  2. +0
    -54
      PEPObjCAdapterTypesTests/Mocks/PEPAttachmentTest.m
  3. +25
    -0
      PEPObjCAdapterTypesTests_iOS/PEPAttachment_SecureCodingTest.m
  4. +0
    -4
      pEpObjCAdapter.xcodeproj/project.pbxproj

+ 0
- 17
PEPObjCAdapterTypesTests/Mocks/PEPAttachmentTest.h View File

@ -1,17 +0,0 @@
//
// PEPAttachmentTest.h
// PEPObjCAdapterTypesTests_macOS
//
// Created by David Alarcon on 27/1/21.
// Copyright © 2021 pp. All rights reserved.
//
#import "PEPAttachment+SecureCoding.h"
NS_ASSUME_NONNULL_BEGIN
@interface PEPAttachmentTest : PEPAttachment
@end
NS_ASSUME_NONNULL_END

+ 0
- 54
PEPObjCAdapterTypesTests/Mocks/PEPAttachmentTest.m View File

@ -1,54 +0,0 @@
//
// PEPAttachmentTest.m
// PEPObjCAdapterTypesTests_macOS
//
// Created by David Alarcon on 27/1/21.
// Copyright © 2021 pp. All rights reserved.
//
#import "PEPAttachmentTest.h"
#import "NSObject+Extension.h"
@implementation PEPAttachmentTest
- (instancetype)init {
if (self = [super init]) {
self.data = [@"attachment" dataUsingEncoding:NSUTF8StringEncoding];
self.size = self.data.length;
self.mimeType = @"text/plain";
self.filename = @"attachment.txt";
self.contentDisposition = PEPContentDispositionAttachment;
s_keys = @[@"data", @"size", @"mimeType", @"filename", @"contentDisposition"];
}
return self;
}
// MARK: - Equality
/**
The keys that should be used to decide `isEqual`.
*/
static NSArray *s_keys;
- (BOOL)isEqualToPEPAttachment:(PEPAttachment * _Nonnull)attachment {
return [self isEqualToObject:attachment basedOnKeys:s_keys];
}
- (NSUInteger)hash {
return [self hashBasedOnKeys:s_keys];
}
- (BOOL)isEqual:(id)object {
if (object == self) {
return YES;
}
if (!object || ![object isKindOfClass:[self class]]) {
return NO;
}
return [self isEqualToPEPAttachment:object];
}
@end

+ 25
- 0
PEPObjCAdapterTypesTests_iOS/PEPAttachment_SecureCodingTest.m View File

@ -10,6 +10,7 @@
#import "PEPTypesTestUtil.h"
#import "PEPAttachment+SecureCoding.h"
#import "NSObject+Extension.h"
@interface PEPAttachment_SecureCodingTest : XCTestCase
@end
@ -78,3 +79,27 @@
}
@end
@implementation PEPAttachment (Equalable)
/**
The keys that should be used to decide `isEqual`.
*/
static NSArray *s_keys;
- (BOOL)isEqualToPEPAttachment:(PEPAttachment * _Nonnull)attachment {
return [self isEqualToObject:attachment basedOnKeys:s_keys];
}
- (BOOL)isEqual:(id)object {
if (object == self) {
return YES;
}
if (!object || ![object isKindOfClass:[self class]]) {
return NO;
}
return [self isEqualToPEPAttachment:object];
}
@end

+ 0
- 4
pEpObjCAdapter.xcodeproj/project.pbxproj View File

@ -415,8 +415,6 @@
43F73BE92166248E00AB4524 /* PEPSync.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPSync.m; sourceTree = "<group>"; };
4E58698125BF2FA900779EAD /* PEPMessage+SecureCoding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PEPMessage+SecureCoding.h"; sourceTree = "<group>"; };
4E58698225BF2FA900779EAD /* PEPMessage+SecureCoding.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "PEPMessage+SecureCoding.m"; sourceTree = "<group>"; };
4E81CD2325C168DC009F140D /* PEPAttachmentTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPAttachmentTest.h; sourceTree = "<group>"; };
4E81CD2425C168DC009F140D /* PEPAttachmentTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPAttachmentTest.m; sourceTree = "<group>"; };
4E81CD2C25C16AEE009F140D /* PEPAttachmentTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPAttachmentTests.m; sourceTree = "<group>"; };
4E81CD3425C16F6B009F140D /* PEPMessageTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPMessageTest.h; sourceTree = "<group>"; };
4E81CD3525C16F6B009F140D /* PEPMessageTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPMessageTest.m; sourceTree = "<group>"; };
@ -819,8 +817,6 @@
4EDB875225C075D800FA045D /* Mocks */ = {
isa = PBXGroup;
children = (
4E81CD2325C168DC009F140D /* PEPAttachmentTest.h */,
4E81CD2425C168DC009F140D /* PEPAttachmentTest.m */,
4E81CD3425C16F6B009F140D /* PEPMessageTest.h */,
4E81CD3525C16F6B009F140D /* PEPMessageTest.m */,
);


Loading…
Cancel
Save