From ce403099f23ced988e1c32c2c9055e088eec4aef Mon Sep 17 00:00:00 2001 From: Dirk Zimmermann Date: Fri, 23 Apr 2021 09:44:49 +0200 Subject: [PATCH] IOSAD-206 Remove group API test utils --- .../TestUtils/XCTestCase+PEPSession.h | 27 --- .../TestUtils/XCTestCase+PEPSession.m | 154 ------------------ 2 files changed, 181 deletions(-) diff --git a/pEpObjCTests/TestUtils/XCTestCase+PEPSession.h b/pEpObjCTests/TestUtils/XCTestCase+PEPSession.h index 0a4213a..ac50bc3 100644 --- a/pEpObjCTests/TestUtils/XCTestCase+PEPSession.h +++ b/pEpObjCTests/TestUtils/XCTestCase+PEPSession.h @@ -76,33 +76,6 @@ NS_ASSUME_NONNULL_BEGIN fingerprint:(NSString * _Nullable)fingerprint error:(NSError * _Nullable * _Nullable)error; -#pragma mark - Group API - -- (PEPGroup * _Nullable)groupCreateGroupIdentity:(PEPIdentity const *)groupIdentity - managerIdentity:(PEPIdentity const *)managerIdentity - memberIdentities:(NSArray *)memberIdentities - error:(NSError * _Nullable * _Nullable)error; - -- (BOOL)groupJoinGroupIdentity:(PEPIdentity const *)groupIdentity - memberIdentity:(PEPIdentity const *)memberIdentity - error:(NSError * _Nullable * _Nullable)error; - -- (BOOL)groupDissolveGroupIdentity:(PEPIdentity const *)groupIdentity - managerIdentity:(PEPIdentity const *)managerIdentity - error:(NSError * _Nullable * _Nullable)error; - -- (BOOL)groupInviteMemberGroupIdentity:(PEPIdentity const *)groupIdentity - memberIdentity:(PEPIdentity const *)memberIdentity - error:(NSError * _Nullable * _Nullable)error; - -- (BOOL)groupRemoveMemberGroupIdentity:(PEPIdentity const *)groupIdentity - memberIdentity:(PEPIdentity const *)memberIdentity - error:(NSError * _Nullable * _Nullable)error; - -- (NSNumber * _Nullable)groupRatingGroupIdentity:(PEPIdentity const *)groupIdentity - managerIdentity:(PEPIdentity const *)managerIdentity - error:(NSError * _Nullable * _Nullable)error; - @end NS_ASSUME_NONNULL_END diff --git a/pEpObjCTests/TestUtils/XCTestCase+PEPSession.m b/pEpObjCTests/TestUtils/XCTestCase+PEPSession.m index 38dda85..ba15852 100644 --- a/pEpObjCTests/TestUtils/XCTestCase+PEPSession.m +++ b/pEpObjCTests/TestUtils/XCTestCase+PEPSession.m @@ -422,158 +422,4 @@ return result; } -#pragma mark - Group API - -- (PEPGroup * _Nullable)groupCreateGroupIdentity:(PEPIdentity const *)groupIdentity - managerIdentity:(PEPIdentity const *)managerIdentity - memberIdentities:(NSArray *)memberIdentities - error:(NSError * _Nullable * _Nullable)error -{ - PEPSession *asyncSession = [PEPSession new]; - XCTestExpectation *exp = [self expectationWithDescription:@"exp"]; - __block PEPGroup *result = nil; - __block NSError *theError = nil; - [asyncSession groupCreateGroupIdentity:groupIdentity - managerIdentity:managerIdentity - memberIdentities:memberIdentities - errorCallback:^(NSError *error) { - theError = error; - [exp fulfill]; - } - successCallback:^(PEPGroup *group) { - result = group; - [exp fulfill]; - }]; - [self waitForExpectations:@[exp] timeout:PEPTestInternalSyncTimeout]; - if (error) { - *error = theError; - } - return result; -} - -- (BOOL)groupJoinGroupIdentity:(PEPIdentity const *)groupIdentity - memberIdentity:(PEPIdentity const *)memberIdentity - error:(NSError * _Nullable * _Nullable)error -{ - PEPSession *asyncSession = [PEPSession new]; - XCTestExpectation *exp = [self expectationWithDescription:@"exp"]; - __block BOOL result = NO; - __block NSError *theError = nil; - [asyncSession groupJoinGroupIdentity:groupIdentity - memberIdentity:memberIdentity - errorCallback:^(NSError * _Nonnull error) { - result = NO; - theError = error; - [exp fulfill]; - } successCallback:^{ - result = YES; - [exp fulfill]; - }]; - [self waitForExpectations:@[exp] timeout:PEPTestInternalSyncTimeout]; - if (error) { - *error = theError; - } - return result; -} - -- (BOOL)groupDissolveGroupIdentity:(PEPIdentity const *)groupIdentity - managerIdentity:(PEPIdentity const *)managerIdentity - error:(NSError * _Nullable * _Nullable)error -{ - PEPSession *asyncSession = [PEPSession new]; - XCTestExpectation *exp = [self expectationWithDescription:@"exp"]; - __block BOOL result = NO; - __block NSError *theError = nil; - [asyncSession groupDissolveGroupIdentity:groupIdentity - managerIdentity:managerIdentity - errorCallback:^(NSError * _Nonnull error) { - result = NO; - theError = error; - [exp fulfill]; - } successCallback:^{ - result = YES; - [exp fulfill]; - }]; - [self waitForExpectations:@[exp] timeout:PEPTestInternalSyncTimeout]; - if (error) { - *error = theError; - } - return result; -} - -- (BOOL)groupInviteMemberGroupIdentity:(PEPIdentity const *)groupIdentity - memberIdentity:(PEPIdentity const *)memberIdentity - error:(NSError * _Nullable * _Nullable)error -{ - PEPSession *asyncSession = [PEPSession new]; - XCTestExpectation *exp = [self expectationWithDescription:@"exp"]; - __block BOOL result = NO; - __block NSError *theError = nil; - [asyncSession groupInviteMemberGroupIdentity:groupIdentity - memberIdentity:memberIdentity - errorCallback:^(NSError * _Nonnull error) { - result = NO; - theError = error; - [exp fulfill]; - } successCallback:^{ - result = YES; - [exp fulfill]; - }]; - [self waitForExpectations:@[exp] timeout:PEPTestInternalSyncTimeout]; - if (error) { - *error = theError; - } - return result; -} - -- (BOOL)groupRemoveMemberGroupIdentity:(PEPIdentity const *)groupIdentity - memberIdentity:(PEPIdentity const *)memberIdentity - error:(NSError * _Nullable * _Nullable)error -{ - PEPSession *asyncSession = [PEPSession new]; - XCTestExpectation *exp = [self expectationWithDescription:@"exp"]; - __block BOOL result = NO; - __block NSError *theError = nil; - [asyncSession groupRemoveMemberGroupIdentity:groupIdentity - memberIdentity:memberIdentity - errorCallback:^(NSError * _Nonnull error) { - result = NO; - theError = error; - [exp fulfill]; - } successCallback:^{ - result = YES; - [exp fulfill]; - }]; - [self waitForExpectations:@[exp] timeout:PEPTestInternalSyncTimeout]; - if (error) { - *error = theError; - } - return result; -} - -- (NSNumber * _Nullable)groupRatingGroupIdentity:(PEPIdentity const *)groupIdentity - managerIdentity:(PEPIdentity const *)managerIdentity - error:(NSError * _Nullable * _Nullable)error -{ - PEPSession *asyncSession = [PEPSession new]; - XCTestExpectation *exp = [self expectationWithDescription:@"exp"]; - __block NSNumber *result = nil; - __block NSError *theError = nil; - [asyncSession groupRatingGroupIdentity:groupIdentity - managerIdentity:managerIdentity - errorCallback:^(NSError * _Nonnull error) { - result = nil; - theError = error; - [exp fulfill]; - } successCallback:^(NSNumber *numRating) { - result = numRating; - [exp fulfill]; - }]; - [self waitForExpectations:@[exp] timeout:PEPTestInternalSyncTimeout]; - if (error) { - *error = theError; - } - return result; -} - @end