IOSAD-206 Remove group API test utils

IOSAD-206
Dirk Zimmermann 2 years ago
parent 48feeb1f30
commit ce403099f2

@ -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<PEPIdentity const *> *)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

@ -422,158 +422,4 @@
return result;
}
#pragma mark - Group API
- (PEPGroup * _Nullable)groupCreateGroupIdentity:(PEPIdentity const *)groupIdentity
managerIdentity:(PEPIdentity const *)managerIdentity
memberIdentities:(NSArray<PEPIdentity const *> *)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

Loading…
Cancel
Save