forked from braintree/braintree_ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request braintree#291 from braintree/refactor-data-collector
Refactor BTDataCollector and PPDataCollector
- Loading branch information
Showing
11 changed files
with
92 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// PPDataCollectorTest.m | ||
// PayPalOneTouch | ||
// | ||
// Copyright © 2015 PayPal, Inc. All rights reserved. | ||
// | ||
|
||
#import <XCTest/XCTest.h> | ||
#import "PayPalDataCollector.h" | ||
|
||
@interface PPDataCollectorTest : XCTestCase | ||
|
||
@end | ||
|
||
@implementation PPDataCollectorTest | ||
|
||
- (void)testDeviceDataContainsCorrelationIdKey { | ||
NSString *deviceData = [PPDataCollector collectPayPalDeviceData]; | ||
NSData *data = [deviceData dataUsingEncoding:NSUTF8StringEncoding]; | ||
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:NULL]; | ||
NSString *cmid = [dictionary objectForKey:@"correlation_id"]; | ||
XCTAssert(cmid.length >= 32); | ||
} | ||
|
||
- (void)testClientMetadataDoesNotContainCorrelationIdKey { | ||
NSString *cmid = [PPDataCollector clientMetadataID]; | ||
XCTAssertTrue([cmid rangeOfString:@"correlation_id"].location == NSNotFound); | ||
XCTAssert(cmid.length >= 12); | ||
} | ||
|
||
@end |