@@ -496,7 +496,7 @@ - (void)testGetFeatureVariableBooleanWithTrue {
496
496
NSString *expectedValueString = @" true" ;
497
497
BOOL expectedValue = true ;
498
498
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyTrue expectedReturn: expectedValueString];
499
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableBoolean: featureKey variableKey: variableKeyTrue userId: kUserId attributes: nil ],
499
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableBoolean: featureKey variableKey: variableKeyTrue userId: kUserId attributes: nil ] boolValue ],
500
500
@" should return %@ for feature variable value %@ " , expectedValue ? @" true" : @" false" , expectedValueString);
501
501
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
502
502
featureKey: featureKey
@@ -515,7 +515,7 @@ - (void)testGetFeatureVariableBooleanWithFalse {
515
515
NSString *expectedValueString = @" false" ;
516
516
BOOL expectedValue = false ;
517
517
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyFalse expectedReturn: expectedValueString];
518
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableBoolean: featureKey variableKey: variableKeyFalse userId: kUserId attributes: nil ],
518
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableBoolean: featureKey variableKey: variableKeyFalse userId: kUserId attributes: nil ] boolValue ],
519
519
@" should return %@ for feature variable value %@ " , expectedValue ? @" true" : @" false" , expectedValueString);
520
520
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
521
521
featureKey: featureKey
@@ -534,7 +534,7 @@ - (void)testGetFeatureVariableBooleanWithInvalidBoolean {
534
534
NSString *expectedValueString = @" nonBooleanValue" ;
535
535
BOOL expectedValue = false ;
536
536
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyNonBoolean expectedReturn: expectedValueString];
537
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableBoolean: featureKey variableKey: variableKeyNonBoolean userId: kUserId attributes: nil ],
537
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableBoolean: featureKey variableKey: variableKeyNonBoolean userId: kUserId attributes: nil ] boolValue ],
538
538
@" should return %@ for feature variable value %@ " , expectedValue ? @" true" : @" false" , expectedValueString);
539
539
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
540
540
featureKey: featureKey
@@ -553,7 +553,7 @@ - (void)testGetFeatureVariableBooleanWithNil {
553
553
NSString *expectedValueString = @" nonBooleanValue" ;
554
554
BOOL expectedValue = false ;
555
555
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyNull expectedReturn: expectedValueString];
556
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableBoolean: featureKey variableKey: variableKeyNull userId: kUserId attributes: nil ],
556
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableBoolean: featureKey variableKey: variableKeyNull userId: kUserId attributes: nil ] boolValue ],
557
557
@" should return %@ for feature variable value %@ " , expectedValue ? @" true" : @" false" , expectedValueString);
558
558
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
559
559
featureKey: featureKey
@@ -572,7 +572,7 @@ - (void)testGetFeatureVariableDoubleWithDouble {
572
572
NSString *expectedValueString = @" 100.54" ;
573
573
double expectedValue = 100.54 ;
574
574
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyDouble expectedReturn: expectedValueString];
575
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableDouble: featureKey variableKey: variableKeyDouble userId: kUserId attributes: nil ],
575
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableDouble: featureKey variableKey: variableKeyDouble userId: kUserId attributes: nil ] doubleValue ],
576
576
@" should return %f for feature variable value %@ " , expectedValue, expectedValueString);
577
577
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
578
578
featureKey: featureKey
@@ -590,7 +590,7 @@ - (void)testGetFeatureVariableDoubleWithInt {
590
590
NSString *expectedValueString = @" 100" ;
591
591
double expectedValue = 100 ;
592
592
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyInt expectedReturn: expectedValueString];
593
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableDouble: featureKey variableKey: variableKeyInt userId: kUserId attributes: nil ],
593
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableDouble: featureKey variableKey: variableKeyInt userId: kUserId attributes: nil ] doubleValue ],
594
594
@" should return %f for feature variable value %@ " , expectedValue, expectedValueString);
595
595
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
596
596
featureKey: featureKey
@@ -608,8 +608,8 @@ - (void)testGetFeatureVariableDoubleWithInvalidDouble {
608
608
NSString *expectedValueString = @" nonDoubleValue" ;
609
609
double expectedValue = 0.0 ;
610
610
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyNonDouble expectedReturn: expectedValueString];
611
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableDouble: featureKey variableKey: variableKeyNonDouble userId: kUserId attributes: nil ],
612
- @" should return %f for feature variable value %@ " , expectedValue , expectedValueString);
611
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableDouble: featureKey variableKey: variableKeyNonDouble userId: kUserId attributes: nil ] doubleValue ],
612
+ @" should return nil for feature variable value %@ " , expectedValueString);
613
613
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
614
614
featureKey: featureKey
615
615
variableKey: variableKeyNonDouble
@@ -624,10 +624,10 @@ - (void)testGetFeatureVariableDoubleWithNil {
624
624
NSString *featureVariableType = FeatureVariableTypeDouble;
625
625
626
626
NSString *expectedValueString = nil ;
627
- double expectedValue = 0.0 ;
627
+ NSNumber * expectedValue = nil ;
628
628
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyNull expectedReturn: expectedValueString];
629
629
XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableDouble: featureKey variableKey: variableKeyNull userId: kUserId attributes: nil ],
630
- @" should return %f for feature variable value %@ " , expectedValue , expectedValueString);
630
+ @" should return nil for feature variable value %@ " , expectedValueString);
631
631
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
632
632
featureKey: featureKey
633
633
variableKey: variableKeyNull
@@ -645,7 +645,7 @@ - (void)testGetFeatureVariableIntegerWithInt {
645
645
NSString *expectedValueString = @" 100" ;
646
646
int expectedValue = 100 ;
647
647
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyInt expectedReturn: expectedValueString];
648
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableInteger: featureKey variableKey: variableKeyInt userId: kUserId attributes: nil ],
648
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableInteger: featureKey variableKey: variableKeyInt userId: kUserId attributes: nil ] integerValue ],
649
649
@" should return %d for feature variable value %@ " , expectedValue, expectedValueString);
650
650
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
651
651
featureKey: featureKey
@@ -664,7 +664,7 @@ - (void)testGetFeatureVariableIntegerWithDouble {
664
664
NSString *expectedValueString = @" 100.45" ;
665
665
int expectedValue = 100 ;
666
666
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyDouble expectedReturn: expectedValueString];
667
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableInteger: featureKey variableKey: variableKeyDouble userId: kUserId attributes: nil ],
667
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableInteger: featureKey variableKey: variableKeyDouble userId: kUserId attributes: nil ] integerValue ],
668
668
@" should return %d for feature variable value %@ " , expectedValue, expectedValueString);
669
669
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
670
670
featureKey: featureKey
@@ -683,7 +683,7 @@ - (void)testGetFeatureVariableIntegerWithInvalidDouble {
683
683
NSString *expectedValueString = @" nonIntegerValue" ;
684
684
int expectedValue = 0 ;
685
685
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableNonInt expectedReturn: expectedValueString];
686
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableInteger: featureKey variableKey: variableNonInt userId: kUserId attributes: nil ],
686
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableInteger: featureKey variableKey: variableNonInt userId: kUserId attributes: nil ] integerValue ],
687
687
@" should return %d for feature variable value %@ " , expectedValue, expectedValueString);
688
688
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
689
689
featureKey: featureKey
@@ -702,7 +702,7 @@ - (void)testGetFeatureVariableIntegerWithNil {
702
702
NSString *expectedValueString = nil ;
703
703
int expectedValue = 0 ;
704
704
id optimizelyMock = [self getOptimizelyMockForFeatureVariableType: featureVariableType variableKey: variableKeyNull expectedReturn: expectedValueString];
705
- XCTAssertEqual (expectedValue, [optimizelyMock getFeatureVariableInteger: featureKey variableKey: variableKeyNull userId: kUserId attributes: nil ],
705
+ XCTAssertEqual (expectedValue, [[ optimizelyMock getFeatureVariableInteger: featureKey variableKey: variableKeyNull userId: kUserId attributes: nil ] integerValue ],
706
706
@" should return %d for feature variable value %@ " , expectedValue, expectedValueString);
707
707
OCMVerify ([optimizelyMock getFeatureVariableValueForType: featureVariableType
708
708
featureKey: featureKey
0 commit comments