@@ -82,10 +82,10 @@ public void TestGetVariationForcedVariationPrecedesAudienceEval()
82
82
OptimizelyUserContextMock = new Mock < OptimizelyUserContext > ( optlyObject , WhitelistedUserId , new UserAttributes ( ) , ErrorHandlerMock . Object , LoggerMock . Object ) ;
83
83
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( GenericUserId ) ;
84
84
// user excluded without audiences and whitelisting
85
- Assert . IsNull ( decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , new UserAttributes ( ) ) . ResultObject ) ;
85
+ Assert . IsNull ( decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig ) . ResultObject ) ;
86
86
87
87
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( WhitelistedUserId ) ;
88
- var actualVariation = decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , new UserAttributes ( ) ) ;
88
+ var actualVariation = decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig ) ;
89
89
90
90
LoggerMock . Verify ( l => l . Log ( LogLevel . INFO , string . Format ( "User \" {0}\" is forced in variation \" vtag5\" ." , WhitelistedUserId ) ) , Times . Once ) ;
91
91
@@ -110,7 +110,7 @@ public void TestGetVariationLogsErrorWhenUserProfileMapItsNull()
110
110
var options = new OptimizelyDecideOption [ ] { OptimizelyDecideOption . INCLUDE_REASONS } ;
111
111
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( GenericUserId ) ;
112
112
113
- var variationResult = decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , new UserAttributes ( ) , options ) ;
113
+ var variationResult = decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , options ) ;
114
114
Assert . AreEqual ( variationResult . DecisionReasons . ToReport ( true ) [ 0 ] , "We were unable to get a user profile map from the UserProfileService." ) ;
115
115
Assert . AreEqual ( variationResult . DecisionReasons . ToReport ( true ) [ 1 ] , "Audiences for experiment \" etag3\" collectively evaluated to FALSE" ) ;
116
116
Assert . AreEqual ( variationResult . DecisionReasons . ToReport ( true ) [ 2 ] , "User \" genericUserId\" does not meet conditions to be in experiment \" etag3\" ." ) ;
@@ -136,15 +136,15 @@ public void TestGetVariationEvaluatesUserProfileBeforeAudienceTargeting()
136
136
137
137
DecisionService decisionService = new DecisionService ( BucketerMock . Object , ErrorHandlerMock . Object , UserProfileServiceMock . Object , LoggerMock . Object ) ;
138
138
139
- decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , new UserAttributes ( ) ) ;
139
+ decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig ) ;
140
140
141
141
LoggerMock . Verify ( l => l . Log ( LogLevel . INFO , string . Format ( "User \" {0}\" does not meet conditions to be in experiment \" {1}\" ." ,
142
142
GenericUserId , experiment . Key ) ) , Times . Once ) ;
143
143
144
144
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( UserProfileId ) ;
145
145
146
146
// ensure that a user with a saved user profile, sees the same variation regardless of audience evaluation
147
- decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , new UserAttributes ( ) ) ;
147
+ decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig ) ;
148
148
149
149
BucketerMock . Verify ( _ => _ . Bucket ( It . IsAny < ProjectConfig > ( ) , It . IsAny < Experiment > ( ) , It . IsAny < string > ( ) , It . IsAny < string > ( ) ) , Times . Never ) ;
150
150
}
@@ -234,7 +234,7 @@ public void TestBucketReturnsVariationStoredInUserProfile()
234
234
OptimizelyUserContextMock = new Mock < OptimizelyUserContext > ( optlyObject , WhitelistedUserId , new UserAttributes ( ) , ErrorHandlerMock . Object , LoggerMock . Object ) ;
235
235
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( UserProfileId ) ;
236
236
237
- var actualVariation = decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , new UserAttributes ( ) ) ;
237
+ var actualVariation = decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig ) ;
238
238
239
239
Assertions . AreEqual ( variation , actualVariation . ResultObject ) ;
240
240
@@ -316,7 +316,7 @@ public void TestGetVariationSavesBucketedVariationIntoUserProfile()
316
316
317
317
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( UserProfileId ) ;
318
318
319
- Assert . IsTrue ( TestData . CompareObjects ( variation . ResultObject , decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , new UserAttributes ( ) ) . ResultObject ) ) ;
319
+ Assert . IsTrue ( TestData . CompareObjects ( variation . ResultObject , decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig ) . ResultObject ) ) ;
320
320
321
321
LoggerMock . Verify ( l => l . Log ( LogLevel . INFO , string . Format ( "Saved variation \" {0}\" of experiment \" {1}\" for user \" {2}\" ." , variation . ResultObject . Id ,
322
322
experiment . Id , UserProfileId ) ) , Times . Once ) ;
@@ -374,7 +374,7 @@ public void TestGetVariationSavesANewUserProfile()
374
374
UserProfileServiceMock . Object , LoggerMock . Object ) ;
375
375
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( UserProfileId ) ;
376
376
377
- var actualVariation = decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , new UserAttributes ( ) ) ;
377
+ var actualVariation = decisionService . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig ) ;
378
378
379
379
Assertions . AreEqual ( variation . ResultObject , actualVariation . ResultObject ) ;
380
380
@@ -578,12 +578,12 @@ public void TestGetVariationForFeatureExperimentGivenNonMutexGroupAndUserIsBucke
578
578
579
579
var optlyObject = new Optimizely ( TestData . Datafile , new ValidEventDispatcher ( ) , LoggerMock . Object ) ;
580
580
581
- OptimizelyUserContextMock = new Mock < OptimizelyUserContext > ( optlyObject , WhitelistedUserId , new UserAttributes ( ) , ErrorHandlerMock . Object , LoggerMock . Object ) ;
581
+ OptimizelyUserContextMock = new Mock < OptimizelyUserContext > ( optlyObject , WhitelistedUserId , userAttributes , ErrorHandlerMock . Object , LoggerMock . Object ) ;
582
582
583
583
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( "user1" ) ;
584
584
585
585
DecisionServiceMock . Setup ( ds => ds . GetVariation ( ProjectConfig . GetExperimentFromKey ( "test_experiment_multivariate" ) ,
586
- OptimizelyUserContextMock . Object , ProjectConfig , userAttributes , It . IsAny < OptimizelyDecideOption [ ] > ( ) ) ) . Returns ( variation ) ;
586
+ OptimizelyUserContextMock . Object , ProjectConfig , It . IsAny < OptimizelyDecideOption [ ] > ( ) ) ) . Returns ( variation ) ;
587
587
588
588
var featureFlag = ProjectConfig . GetFeatureFlagFromKey ( "multi_variate_feature" ) ;
589
589
var decision = DecisionServiceMock . Object . GetVariationForFeatureExperiment ( featureFlag , OptimizelyUserContextMock . Object , userAttributes , ProjectConfig , new OptimizelyDecideOption [ ] { } ) ;
@@ -604,11 +604,10 @@ public void TestGetVariationForFeatureExperimentGivenMutexGroupAndUserIsBucketed
604
604
605
605
var optlyObject = new Optimizely ( TestData . Datafile , new ValidEventDispatcher ( ) , LoggerMock . Object ) ;
606
606
607
- OptimizelyUserContextMock = new Mock < OptimizelyUserContext > ( optlyObject , WhitelistedUserId , new UserAttributes ( ) , ErrorHandlerMock . Object , LoggerMock . Object ) ;
607
+ OptimizelyUserContextMock = new Mock < OptimizelyUserContext > ( optlyObject , WhitelistedUserId , userAttributes , ErrorHandlerMock . Object , LoggerMock . Object ) ;
608
608
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( "user1" ) ;
609
609
610
- DecisionServiceMock . Setup ( ds => ds . GetVariation ( ProjectConfig . GetExperimentFromKey ( "group_experiment_1" ) , OptimizelyUserContextMock . Object , ProjectConfig ,
611
- userAttributes ) ) . Returns ( variation ) ;
610
+ DecisionServiceMock . Setup ( ds => ds . GetVariation ( ProjectConfig . GetExperimentFromKey ( "group_experiment_1" ) , OptimizelyUserContextMock . Object , ProjectConfig ) ) . Returns ( variation ) ;
612
611
613
612
var featureFlag = ProjectConfig . GetFeatureFlagFromKey ( "boolean_feature" ) ;
614
613
var actualDecision = DecisionServiceMock . Object . GetVariationForFeatureExperiment ( featureFlag , OptimizelyUserContextMock . Object , userAttributes , ProjectConfig , new OptimizelyDecideOption [ ] { } ) ;
@@ -625,7 +624,7 @@ public void TestGetVariationForFeatureExperimentGivenMutexGroupAndUserNotBuckete
625
624
var mutexExperiment = ProjectConfig . GetExperimentFromKey ( "group_experiment_1" ) ;
626
625
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( "user1" ) ;
627
626
628
- DecisionServiceMock . Setup ( ds => ds . GetVariation ( It . IsAny < Experiment > ( ) , It . IsAny < OptimizelyUserContext > ( ) , ProjectConfig , It . IsAny < UserAttributes > ( ) , It . IsAny < OptimizelyDecideOption [ ] > ( ) ) )
627
+ DecisionServiceMock . Setup ( ds => ds . GetVariation ( It . IsAny < Experiment > ( ) , It . IsAny < OptimizelyUserContext > ( ) , ProjectConfig , It . IsAny < OptimizelyDecideOption [ ] > ( ) ) )
629
628
. Returns ( Result < Variation > . NullResult ( null ) ) ;
630
629
631
630
var featureFlag = ProjectConfig . GetFeatureFlagFromKey ( "boolean_feature" ) ;
@@ -975,7 +974,7 @@ public void TestGetVariationForFeatureWhenTheUserIsBuckedtedInBothExperimentAndR
975
974
OptimizelyUserContextMock = new Mock < OptimizelyUserContext > ( optlyObject , WhitelistedUserId , userAttributes , ErrorHandlerMock . Object , LoggerMock . Object ) ;
976
975
OptimizelyUserContextMock . Setup ( ouc => ouc . GetUserId ( ) ) . Returns ( UserProfileId ) ;
977
976
978
- DecisionServiceMock . Setup ( ds => ds . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , userAttributes , It . IsAny < OptimizelyDecideOption [ ] > ( ) ) ) . Returns ( variation ) ;
977
+ DecisionServiceMock . Setup ( ds => ds . GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig , It . IsAny < OptimizelyDecideOption [ ] > ( ) ) ) . Returns ( variation ) ;
979
978
var actualDecision = DecisionServiceMock . Object . GetVariationForFeatureExperiment ( featureFlag , OptimizelyUserContextMock . Object , userAttributes , ProjectConfig , new OptimizelyDecideOption [ ] { } ) ;
980
979
981
980
// The user is bucketed into feature experiment's variation.
0 commit comments