@@ -129,7 +129,7 @@ public void TestGetVariationForcedVariationPrecedesAudienceEval()
129129 WhitelistedUserId ) ) , Times . Once ) ;
130130
131131 // no attributes provided for a experiment that has an audience
132- Assertions . AreEqual ( expectedVariation , actualVariation . ResultObject ) ;
132+ Assertions . AreEqual ( expectedVariation , actualVariation . ResultObject . Variation ) ;
133133
134134 BucketerMock . Verify (
135135 _ => _ . Bucket ( It . IsAny < ProjectConfig > ( ) , It . IsAny < Experiment > ( ) , It . IsAny < string > ( ) ,
@@ -327,7 +327,7 @@ public void TestBucketReturnsVariationStoredInUserProfile()
327327 var actualVariation = decisionService . GetVariation ( experiment ,
328328 OptimizelyUserContextMock . Object , ProjectConfig ) ;
329329
330- Assertions . AreEqual ( variation , actualVariation . ResultObject ) ;
330+ Assertions . AreEqual ( variation , actualVariation . ResultObject . Variation ) ;
331331
332332 Assert . AreEqual ( actualVariation . DecisionReasons . ToReport ( true ) . Count , 1 ) ;
333333 Assert . AreEqual ( actualVariation . DecisionReasons . ToReport ( true ) [ 0 ] ,
@@ -423,7 +423,7 @@ public void TestGetVariationSavesBucketedVariationIntoUserProfile()
423423 Assert . IsTrue ( TestData . CompareObjects ( variation . ResultObject ,
424424 decisionService .
425425 GetVariation ( experiment , OptimizelyUserContextMock . Object , ProjectConfig ) .
426- ResultObject ) ) ;
426+ ResultObject . Variation ) ) ;
427427
428428 LoggerMock . Verify ( l => l . Log ( LogLevel . INFO , string . Format (
429429 "Saved variation \" {0}\" of experiment \" {1}\" for user \" {2}\" ." ,
@@ -494,8 +494,7 @@ public void TestGetVariationSavesANewUserProfile()
494494
495495 var actualVariation = decisionService . GetVariation ( experiment ,
496496 OptimizelyUserContextMock . Object , ProjectConfig ) ;
497-
498- Assertions . AreEqual ( variation . ResultObject , actualVariation . ResultObject ) ;
497+ Assertions . AreEqual ( variation . ResultObject , actualVariation . ResultObject . Variation ) ;
499498
500499 UserProfileServiceMock . Verify ( _ => _ . Save ( It . IsAny < Dictionary < string , object > > ( ) ) ,
501500 Times . Once ) ;
@@ -732,10 +731,11 @@ public void TestGetVariationForFeatureExperimentGivenNonMutexGroupAndUserNotBuck
732731 public void TestGetVariationForFeatureExperimentGivenNonMutexGroupAndUserIsBucketed ( )
733732 {
734733 var experiment = ProjectConfig . GetExperimentFromKey ( "test_experiment_multivariate" ) ;
735- var variation = Result < Variation > . NewResult (
736- ProjectConfig . GetVariationFromId ( "test_experiment_multivariate" , "122231" ) ,
734+ var variationObj = ProjectConfig . GetVariationFromId ( "test_experiment_multivariate" , "122231" ) ;
735+ var variation = Result < VariationDecisionResult > . NewResult (
736+ new VariationDecisionResult ( variationObj , null , false ) ,
737737 DecisionReasons ) ;
738- var expectedDecision = new FeatureDecision ( experiment , variation . ResultObject ,
738+ var expectedDecision = new FeatureDecision ( experiment , variationObj ,
739739 FeatureDecision . DECISION_SOURCE_FEATURE_TEST ) ;
740740 var userAttributes = new UserAttributes ( ) ;
741741
@@ -770,10 +770,12 @@ public void TestGetVariationForFeatureExperimentGivenNonMutexGroupAndUserIsBucke
770770 public void TestGetVariationForFeatureExperimentGivenMutexGroupAndUserIsBucketed ( )
771771 {
772772 var mutexExperiment = ProjectConfig . GetExperimentFromKey ( "group_experiment_1" ) ;
773- var variation =
774- Result < Variation > . NewResult ( mutexExperiment . Variations [ 0 ] , DecisionReasons ) ;
773+ var variationObj = mutexExperiment . Variations [ 0 ] ;
774+ var variation = Result < VariationDecisionResult > . NewResult (
775+ new VariationDecisionResult ( variationObj , null , false ) ,
776+ DecisionReasons ) ;
775777 var userAttributes = new UserAttributes ( ) ;
776- var expectedDecision = new FeatureDecision ( mutexExperiment , variation . ResultObject ,
778+ var expectedDecision = new FeatureDecision ( mutexExperiment , variationObj ,
777779 FeatureDecision . DECISION_SOURCE_FEATURE_TEST ) ;
778780
779781 var optlyObject = new Optimizely ( TestData . Datafile , new ValidEventDispatcher ( ) ,
@@ -816,7 +818,7 @@ public void TestGetVariationForFeatureExperimentGivenMutexGroupAndUserNotBuckete
816818 It . IsAny < OptimizelyUserContext > ( ) , ProjectConfig ,
817819 It . IsAny < OptimizelyDecideOption [ ] > ( ) , It . IsAny < UserProfileTracker > ( ) ,
818820 It . IsAny < DecisionReasons > ( ) ) ) .
819- Returns ( Result < Variation > . NullResult ( null ) ) ;
821+ Returns ( Result < VariationDecisionResult > . NullResult ( null ) ) ;
820822
821823 var featureFlag = ProjectConfig . GetFeatureFlagFromKey ( "boolean_feature" ) ;
822824 var actualDecision = DecisionServiceMock . Object . GetVariationForFeatureExperiment (
@@ -1312,10 +1314,11 @@ public void TestGetVariationForFeatureWhenTheUserIsBuckedtedInBothExperimentAndR
13121314 var featureFlag = ProjectConfig . GetFeatureFlagFromKey ( "string_single_variable_feature" ) ;
13131315 var experiment =
13141316 ProjectConfig . GetExperimentFromKey ( "test_experiment_with_feature_rollout" ) ;
1315- var variation = Result < Variation > . NewResult (
1316- ProjectConfig . GetVariationFromId ( "test_experiment_with_feature_rollout" , "122236" ) ,
1317+ var variationObj = ProjectConfig . GetVariationFromId ( "test_experiment_with_feature_rollout" , "122236" ) ;
1318+ var variation = Result < VariationDecisionResult > . NewResult (
1319+ new VariationDecisionResult ( variationObj , null , false ) ,
13171320 DecisionReasons ) ;
1318- var expectedDecision = new FeatureDecision ( experiment , variation . ResultObject ,
1321+ var expectedDecision = new FeatureDecision ( experiment , variationObj ,
13191322 FeatureDecision . DECISION_SOURCE_FEATURE_TEST ) ;
13201323 var userAttributes = new UserAttributes
13211324 {
@@ -1332,7 +1335,7 @@ public void TestGetVariationForFeatureWhenTheUserIsBuckedtedInBothExperimentAndR
13321335 BucketerMock .
13331336 Setup ( bm => bm . Bucket ( ProjectConfig , experiment , It . IsAny < string > ( ) ,
13341337 It . IsAny < string > ( ) ) ) .
1335- Returns ( variation ) ;
1338+ Returns ( Result < Variation > . NewResult ( variationObj , DecisionReasons ) ) ;
13361339
13371340 DecisionServiceMock . Setup ( ds => ds . GetVariation ( experiment ,
13381341 OptimizelyUserContextMock . Object , ProjectConfig ,
0 commit comments