@@ -158,17 +158,17 @@ class DecisionServiceTests_Experiments: XCTestCase {
158
158
] ,
159
159
[
160
160
" id " : kAudienceIdExactInvalidValue,
161
- " conditions " : [ " type " : " custom_attribute " , " name " : " age " , " match " : " exact " , " value " : [ " invalid " ] ] ,
161
+ " conditions " : [ " type " : " custom_attribute " , " name " : " age " , " match " : " exact " , " value " : [ " invalid " : nil ] ] ,
162
162
" name " : " age "
163
163
] ,
164
164
[
165
165
" id " : kAudienceIdGtInvalidValue,
166
- " conditions " : [ " type " : " custom_attribute " , " name " : " age " , " match " : " gt " , " value " : [ " invalid " ] ] ,
166
+ " conditions " : [ " type " : " custom_attribute " , " name " : " age " , " match " : " gt " , " value " : [ " invalid " : nil ] ] ,
167
167
" name " : " age "
168
168
] ,
169
169
[
170
170
" id " : kAudienceIdLtInvalidValue,
171
- " conditions " : [ " type " : " custom_attribute " , " name " : " age " , " match " : " lt " , " value " : [ " invalid " ] ] ,
171
+ " conditions " : [ " type " : " custom_attribute " , " name " : " age " , " match " : " lt " , " value " : [ " invalid " : nil ] ] ,
172
172
" name " : " age "
173
173
] ,
174
174
[
@@ -565,7 +565,7 @@ extension DecisionServiceTests_Experiments {
565
565
}
566
566
567
567
func testDoesMeetAudienceConditionsWithExactMatchAndInvalidValue( ) {
568
- MockLogger . expectedLog = OptimizelyError . evaluateAttributeInvalidCondition ( " { \" match \" : \" exact \" , \" value \" :{}, \" name \" : \" age \" , \" type \" : \" custom_attribute \" } " ) . localizedDescription
568
+ MockLogger . expectedLog = OptimizelyError . evaluateAttributeInvalidCondition ( " { \" match \" : \" exact \" , \" value \" :{ \" invalid \" :{} },\" name \" : \" age \" , \" type \" : \" custom_attribute \" } " ) . localizedDescription
569
569
self . config. project. typedAudiences = try ! OTUtils . model ( from: sampleTypedAudiencesData)
570
570
571
571
experiment = try ! OTUtils . model ( from: sampleExperimentData)
@@ -575,7 +575,7 @@ extension DecisionServiceTests_Experiments {
575
575
result = self . decisionService. doesMeetAudienceConditions ( config: config,
576
576
experiment: experiment,
577
577
user: OTUtils . user ( userId: kUserId, attributes: kAttributesAgeMatch) ) . result
578
-
578
+ XCTAssert ( MockLogger . logFound )
579
579
XCTAssertFalse ( result)
580
580
}
581
581
@@ -612,7 +612,7 @@ extension DecisionServiceTests_Experiments {
612
612
}
613
613
614
614
func testDoesMeetAudienceConditionsWithGreaterMatchAndInvalidValue( ) {
615
- MockLogger . expectedLog = OptimizelyError . evaluateAttributeInvalidCondition ( " { \" match \" : \" gt \" , \" value \" :{}, \" name \" : \" age \" , \" type \" : \" custom_attribute \" } " ) . localizedDescription
615
+ MockLogger . expectedLog = OptimizelyError . evaluateAttributeInvalidCondition ( " { \" match \" : \" gt \" , \" value \" :{ \" invalid \" :{} },\" name \" : \" age \" , \" type \" : \" custom_attribute \" } " ) . localizedDescription
616
616
self . config. project. typedAudiences = try ! OTUtils . model ( from: sampleTypedAudiencesData)
617
617
618
618
experiment = try ! OTUtils . model ( from: sampleExperimentData)
@@ -622,7 +622,7 @@ extension DecisionServiceTests_Experiments {
622
622
result = self . decisionService. doesMeetAudienceConditions ( config: config,
623
623
experiment: experiment,
624
624
user: OTUtils . user ( userId: kUserId, attributes: kAttributesAgeMatch) ) . result
625
-
625
+ XCTAssert ( MockLogger . logFound )
626
626
XCTAssertFalse ( result)
627
627
}
628
628
@@ -643,7 +643,7 @@ extension DecisionServiceTests_Experiments {
643
643
}
644
644
645
645
func testDoesMeetAudienceConditionsWithLessMatchAndInvalidValue( ) {
646
- MockLogger . expectedLog = OptimizelyError . evaluateAttributeInvalidCondition ( " { \" match \" : \" lt \" , \" value \" :{}, \" name \" : \" age \" , \" type \" : \" custom_attribute \" } " ) . localizedDescription
646
+ MockLogger . expectedLog = OptimizelyError . evaluateAttributeInvalidCondition ( " { \" match \" : \" lt \" , \" value \" :{ \" invalid \" :{} },\" name \" : \" age \" , \" type \" : \" custom_attribute \" } " ) . localizedDescription
647
647
self . config. project. typedAudiences = try ! OTUtils . model ( from: sampleTypedAudiencesData)
648
648
649
649
experiment = try ! OTUtils . model ( from: sampleExperimentData)
@@ -653,7 +653,7 @@ extension DecisionServiceTests_Experiments {
653
653
result = self . decisionService. doesMeetAudienceConditions ( config: config,
654
654
experiment: experiment,
655
655
user: OTUtils . user ( userId: kUserId, attributes: kAttributesAgeMatch) ) . result
656
-
656
+ XCTAssert ( MockLogger . logFound )
657
657
XCTAssertFalse ( result)
658
658
}
659
659
0 commit comments