Skip to content

Commit 8b1d1ba

Browse files
committed
Update assertion type for properties of ParseClientConfiguration.
1 parent 4b67292 commit 8b1d1ba

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Parse/ParseClientConfiguration.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ + (instancetype)configurationWithBlock:(void (^)(id<ParseMutableClientConfigurat
6060
///--------------------------------------
6161

6262
- (void)setApplicationId:(NSString *)applicationId {
63-
PFConsistencyAssert(applicationId.length, @"'applicationId' should not be nil.");
63+
PFParameterAssert(applicationId.length, @"'applicationId' should not be nil.");
6464
_applicationId = [applicationId copy];
6565
}
6666

6767
- (void)setClientKey:(NSString *)clientKey {
68-
PFConsistencyAssert(clientKey.length, @"'clientKey' should not be nil.");
68+
PFParameterAssert(clientKey.length, @"'clientKey' should not be nil.");
6969
_clientKey = [clientKey copy];
7070
}
7171

@@ -76,18 +76,18 @@ - (void)setServer:(NSString *)server {
7676
}
7777

7878
- (void)setApplicationGroupIdentifier:(NSString *)applicationGroupIdentifier {
79-
PFConsistencyAssert(applicationGroupIdentifier == nil ||
80-
[PFFileManager isApplicationGroupContainerReachableForGroupIdentifier:applicationGroupIdentifier],
81-
@"ApplicationGroupContainer is unreachable. Please double check your Xcode project settings.");
79+
PFParameterAssert(applicationGroupIdentifier == nil ||
80+
[PFFileManager isApplicationGroupContainerReachableForGroupIdentifier:applicationGroupIdentifier],
81+
@"ApplicationGroupContainer is unreachable. Please double check your Xcode project settings.");
8282

8383
_applicationGroupIdentifier = [applicationGroupIdentifier copy];
8484
}
8585

8686
- (void)setContainingApplicationBundleIdentifier:(NSString *)containingApplicationBundleIdentifier {
87-
PFConsistencyAssert([PFApplication currentApplication].extensionEnvironment,
88-
@"'containingApplicationBundleIdentifier' cannot be set in non-extension environment");
89-
PFConsistencyAssert(containingApplicationBundleIdentifier.length,
90-
@"'containingApplicationBundleIdentifier' should not be nil.");
87+
PFParameterAssert([PFApplication currentApplication].extensionEnvironment,
88+
@"'containingApplicationBundleIdentifier' cannot be set in non-extension environment");
89+
PFParameterAssert(containingApplicationBundleIdentifier.length,
90+
@"'containingApplicationBundleIdentifier' should not be nil.");
9191

9292
_containingApplicationBundleIdentifier = containingApplicationBundleIdentifier;
9393
}

Tests/Unit/ParseSetupUnitTests.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ - (void)testInitializeWithLDSAfterInitializeShouldThrowException {
4848

4949
- (void)testInitializeWithNilApplicationIdNilClientKeyShouldThrowException {
5050
NSString *yolo = nil;
51-
PFAssertThrowsInconsistencyException([Parse setApplicationId:yolo clientKey:yolo]);
52-
PFAssertThrowsInconsistencyException([Parse setApplicationId:yolo clientKey:@"a"]);
53-
PFAssertThrowsInconsistencyException([Parse setApplicationId:@"a" clientKey:yolo]);
51+
PFAssertThrowsInvalidArgumentException([Parse setApplicationId:yolo clientKey:yolo]);
52+
PFAssertThrowsInvalidArgumentException([Parse setApplicationId:yolo clientKey:@"a"]);
53+
PFAssertThrowsInvalidArgumentException([Parse setApplicationId:@"a" clientKey:yolo]);
5454
}
5555

5656
@end

0 commit comments

Comments
 (0)