Skip to content

Commit 2e4c446

Browse files
Changes from code review.
1 parent f6e4c6f commit 2e4c446

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

OptimizelySDKCore/OptimizelySDKCoreTests/OPTLYBuilderTest.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ - (void)testBuilderCanAssignErrorHandler {
6868
XCTAssertNotNil(customOptimizely);
6969
XCTAssertNotNil(customOptimizely.errorHandler);
7070
XCTAssertNotEqual(errorHandler, defaultOptimizely.errorHandler, @"Default OPTLYBuilder should create its own Error Handler");
71-
XCTAssertEqual(errorHandler, customOptimizely.errorHandler, @"Should be same object with custom Builder");
71+
XCTAssertEqual(errorHandler, customOptimizely.errorHandler, @"This module should be the same as that created in the OPLTYManager builder.");
7272
}
7373

7474
- (void)testBuilderCanAssignEventDispatcher {
@@ -121,7 +121,7 @@ - (void)testBuilderCanAssignDatafileManager {
121121

122122
XCTAssertNotNil(customOptimizely);
123123
XCTAssertNotNil(customOptimizely.datafileManager);
124-
XCTAssertEqualObjects(datafileManager, customOptimizely.datafileManager, @"Should be same object with custom Builder");
124+
XCTAssertEqualObjects(datafileManager, customOptimizely.datafileManager, @"This module should be the same as that created in the OPLTYManager builder.");
125125
}
126126

127127
- (void)testInitializationWithoutBuilder {

OptimizelySDKDatafileManager/OptimizelySDKDatafileManager/OPTLYDatafileManager.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#import <OptimizelySDKShared/OPTLYDataStore.h>
2323
#import "OPTLYDatafileManager.h"
2424

25+
// default datafile download interval is 2 minutes
2526
NSTimeInterval const kDefaultDatafileFetchInterval_s = 120;
2627

2728
@interface OPTLYDatafileManager ()

OptimizelySDKDatafileManager/OptimizelySDKDatafileManagerTests/OPTLYDatafileManagerTest.m

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,14 @@
2323

2424
static NSString *const kProjectId = @"6372300739";
2525
static NSString *const kDatamodelDatafileName = @"datafile_6372300739";
26-
static NSTimeInterval kDatafileDownloadInteval = 5;
27-
<<<<<<< HEAD
26+
static NSTimeInterval kDatafileDownloadInteval = 5; // in seconds
2827
static NSString *const kLastModifiedDate = @"Mon, 28 Nov 2016 06:10:59 GMT";
2928

3029
@interface OPTLYDatafileManager(test)
3130
@property (nonatomic, strong) NSTimer *datafileDownloadTimer;
32-
- (void)downloadDatafile:(NSString *)projectId completionHandler:(OPTLYHTTPRequestManagerResponse)completion;
33-
=======
34-
35-
@interface OPTLYDatafileManager(test)
36-
@property (nonatomic, strong) NSTimer *datafileDownloadTimer;
37-
>>>>>>> Added a timer to the datafile manager to periodically download the datafile. Also moved the datafile manager protocol to core as the core should have a basic datafile downloader (the network classes will be moved to core as well in another commit.). Cleaned up the headers and was being more deligent about alphabetizing imports and initializing modules.
3831
- (void)saveDatafile:(NSData *)datafile;
3932
- (nullable NSString *)getLastModifiedDate:(nonnull NSString *)projectId;
33+
- (void)downloadDatafile:(NSString *)projectId completionHandler:(OPTLYHTTPRequestManagerResponse)completion;
4034
@end
4135

4236
@interface OPTLYDatafileManagerTest : XCTestCase
@@ -154,7 +148,7 @@ - (void)testDatafileManagerDownloadDatafileSavesDatafile {
154148
[self waitForExpectationsWithTimeout:2 handler:nil];
155149
}
156150

157-
// timer is enabled if the download intervao is > 0
151+
// timer is enabled if the download interval is > 0
158152
- (void)testNetworkTimerIsEnabled
159153
{
160154
OPTLYDatafileManager *datafileManager = [OPTLYDatafileManager initWithBuilderBlock:^(OPTLYDatafileManagerBuilder * _Nullable builder) {
@@ -178,7 +172,7 @@ - (void)testNetworkTimerIsDisabled
178172

179173
// check that the timer is set correctly
180174
XCTAssertNil(datafileManager.datafileDownloadTimer, @"Timer should be nil.");
181-
XCTAssertFalse(datafileManager.datafileDownloadTimer.valid, @"Timer shoul not be valid.");
175+
XCTAssertFalse(datafileManager.datafileDownloadTimer.valid, @"Timer should not be valid.");
182176

183177
datafileManager = [OPTLYDatafileManager initWithBuilderBlock:^(OPTLYDatafileManagerBuilder * _Nullable builder) {
184178
builder.projectId = kProjectId;

OptimizelySDKShared/OptimizelySDKSharedTests/OPTLYManagerBuilderTest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ - (void)testBuilderCanAssignErrorHandler {
7777
XCTAssertNotNil(customManager);
7878
XCTAssertNotNil(customManager.errorHandler);
7979
XCTAssertNotEqual(errorHandler, defaultManager.errorHandler, @"Default OPTLYBuilder should create its own Error Handler");
80-
XCTAssertEqual(errorHandler, customManager.errorHandler, @"Should be same object with custom Builder");
80+
XCTAssertEqual(errorHandler, customManager.errorHandler, @"This module should be the same as that created in the OPLTYManager builder.");
8181
}
8282

8383
- (void)testBuilderCanAssignEventDispatcher {

0 commit comments

Comments
 (0)