@@ -501,7 +501,7 @@ public void TestGetVariationForFeatureExperimentGivenNonMutexGroupAndUserIsBucke
501501 {
502502 var experiment = ProjectConfig . GetExperimentFromKey ( "test_experiment_multivariate" ) ;
503503 var variation = ProjectConfig . GetVariationFromId ( "test_experiment_multivariate" , "122231" ) ;
504- var expectedDecision = new FeatureDecision ( experiment . Id , variation . Id , FeatureDecision . DECISION_SOURCE_EXPERIMENT ) ;
504+ var expectedDecision = new FeatureDecision ( experiment , variation , FeatureDecision . DECISION_SOURCE_EXPERIMENT ) ;
505505 var userAttributes = new UserAttributes ( ) ;
506506
507507 DecisionServiceMock . Setup ( ds => ds . GetVariation ( ProjectConfig . GetExperimentFromKey ( "test_experiment_multivariate" ) ,
@@ -522,7 +522,7 @@ public void TestGetVariationForFeatureExperimentGivenMutexGroupAndUserIsBucketed
522522 var mutexExperiment = ProjectConfig . GetExperimentFromKey ( "group_experiment_1" ) ;
523523 var variation = mutexExperiment . Variations [ 0 ] ;
524524 var userAttributes = new UserAttributes ( ) ;
525- var expectedDecision = new FeatureDecision ( mutexExperiment . Id , variation . Id , FeatureDecision . DECISION_SOURCE_EXPERIMENT ) ;
525+ var expectedDecision = new FeatureDecision ( mutexExperiment , variation , FeatureDecision . DECISION_SOURCE_EXPERIMENT ) ;
526526
527527 DecisionServiceMock . Setup ( ds => ds . GetVariation ( ProjectConfig . GetExperimentFromKey ( "group_experiment_1" ) , "user1" ,
528528 userAttributes ) ) . Returns ( variation ) ;
@@ -585,7 +585,7 @@ public void TestGetVariationForFeatureRolloutWhenUserIsBucketedInTheTargetingRul
585585 var rollout = ProjectConfig . GetRolloutFromId ( rolloutId ) ;
586586 var experiment = rollout . Experiments [ 0 ] ;
587587 var variation = experiment . Variations [ 0 ] ;
588- var expectedDecision = new FeatureDecision ( experiment . Id , variation . Id , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
588+ var expectedDecision = new FeatureDecision ( experiment , variation , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
589589
590590 var userAttributes = new UserAttributes {
591591 { "browser_type" , "chrome" }
@@ -613,7 +613,7 @@ public void TestGetVariationForFeatureRolloutWhenUserIsNotBucketedInTheTargeting
613613 var experiment = rollout . Experiments [ 0 ] ;
614614 var everyoneElseRule = rollout . Experiments [ rollout . Experiments . Count - 1 ] ;
615615 var variation = everyoneElseRule . Variations [ 0 ] ;
616- var expectedDecision = new FeatureDecision ( everyoneElseRule . Id , variation . Id , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
616+ var expectedDecision = new FeatureDecision ( everyoneElseRule , variation , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
617617
618618 var userAttributes = new UserAttributes {
619619 { "browser_type" , "chrome" }
@@ -669,7 +669,7 @@ public void TestGetVariationForFeatureRolloutWhenUserDoesNotQualifyForAnyTargeti
669669 var experiment1 = rollout . Experiments [ 1 ] ;
670670 var everyoneElseRule = rollout . Experiments [ rollout . Experiments . Count - 1 ] ;
671671 var variation = everyoneElseRule . Variations [ 0 ] ;
672- var expectedDecision = new FeatureDecision ( everyoneElseRule . Id , variation . Id , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
672+ var expectedDecision = new FeatureDecision ( everyoneElseRule , variation , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
673673
674674 BucketerMock . Setup ( bm => bm . Bucket ( It . IsAny < ProjectConfig > ( ) , everyoneElseRule , It . IsAny < string > ( ) , It . IsAny < string > ( ) ) ) . Returns ( variation ) ;
675675 var decisionService = new DecisionService ( BucketerMock . Object , ErrorHandlerMock . Object , ProjectConfig , null , LoggerMock . Object ) ;
@@ -708,7 +708,7 @@ public void TestGetVariationForFeatureRolloutAudienceAndTrafficeAllocationCheck(
708708 } ) ;
709709
710710 // Returned variation id should be '177773' because of audience 'iPhone users in San Francisco'.
711- var expectedDecision = new FeatureDecision ( expWithAudienceiPhoneUsers . Id , varWithAudienceiPhoneUsers . Id , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
711+ var expectedDecision = new FeatureDecision ( expWithAudienceiPhoneUsers , varWithAudienceiPhoneUsers , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
712712 Assert . IsTrue ( TestData . CompareObjects ( expectedDecision , actualDecision ) ) ;
713713
714714 // Calling with audience Chrome users.
@@ -718,15 +718,15 @@ public void TestGetVariationForFeatureRolloutAudienceAndTrafficeAllocationCheck(
718718 } ) ;
719719
720720 // Returned variation id should be '177771' because of audience 'Chrome users'.
721- expectedDecision = new FeatureDecision ( expWithAudienceChromeUsers . Id , varWithAudienceChromeUsers . Id , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
721+ expectedDecision = new FeatureDecision ( expWithAudienceChromeUsers , varWithAudienceChromeUsers , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
722722 Assert . IsTrue ( TestData . CompareObjects ( expectedDecision , actualDecision ) ) ;
723723
724724 // Calling with no audience.
725725 mockBucketer . Setup ( bm => bm . GenerateBucketValue ( It . IsAny < string > ( ) ) ) . Returns ( 8000 ) ;
726726 actualDecision = decisionService . GetVariationForFeatureRollout ( featureFlag , GenericUserId , new UserAttributes ( ) ) ;
727727
728728 // Returned variation id should be of everyone else rule because of no audience.
729- expectedDecision = new FeatureDecision ( expWithNoAudience . Id , varWithNoAudience . Id , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
729+ expectedDecision = new FeatureDecision ( expWithNoAudience , varWithNoAudience , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
730730 Assert . IsTrue ( TestData . CompareObjects ( expectedDecision , actualDecision ) ) ;
731731
732732 // Calling with audience 'Chrome users' and traffice allocation '9500'.
@@ -752,7 +752,7 @@ public void TestGetVariationForFeatureWhenTheUserIsBucketedIntoFeatureExperiment
752752 var expectedExperimentId = featureFlag . ExperimentIds [ 0 ] ;
753753 var expectedExperiment = ProjectConfig . GetExperimentFromId ( expectedExperimentId ) ;
754754 var variation = expectedExperiment . Variations [ 0 ] ;
755- var expectedDecision = new FeatureDecision ( expectedExperimentId , variation . Id , FeatureDecision . DECISION_SOURCE_EXPERIMENT ) ;
755+ var expectedDecision = new FeatureDecision ( expectedExperiment , variation , FeatureDecision . DECISION_SOURCE_EXPERIMENT ) ;
756756
757757 DecisionServiceMock . Setup ( ds => ds . GetVariationForFeatureExperiment ( It . IsAny < FeatureFlag > ( ) , It . IsAny < string > ( ) ,
758758 It . IsAny < UserAttributes > ( ) ) ) . Returns ( expectedDecision ) ;
@@ -771,7 +771,7 @@ public void TestGetVariationForFeatureWhenTheUserIsNotBucketedIntoFeatureExperim
771771 var rollout = ProjectConfig . GetRolloutFromId ( rolloutId ) ;
772772 var expectedExperiment = rollout . Experiments [ 0 ] ;
773773 var variation = expectedExperiment . Variations [ 0 ] ;
774- var expectedDecision = new FeatureDecision ( expectedExperiment . Id , variation . Id , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
774+ var expectedDecision = new FeatureDecision ( expectedExperiment , variation , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
775775
776776 DecisionServiceMock . Setup ( ds => ds . GetVariationForFeatureExperiment ( It . IsAny < FeatureFlag > ( ) , It . IsAny < string > ( ) ,
777777 It . IsAny < UserAttributes > ( ) ) ) . Returns < Variation > ( null ) ;
@@ -808,7 +808,7 @@ public void TestGetVariationForFeatureWhenTheUserIsBuckedtedInBothExperimentAndR
808808 var featureFlag = ProjectConfig . GetFeatureFlagFromKey ( "string_single_variable_feature" ) ;
809809 var experiment = ProjectConfig . GetExperimentFromKey ( "test_experiment_with_feature_rollout" ) ;
810810 var variation = ProjectConfig . GetVariationFromId ( "test_experiment_with_feature_rollout" , "122236" ) ;
811- var expectedDecision = new FeatureDecision ( experiment . Id , variation . Id , FeatureDecision . DECISION_SOURCE_EXPERIMENT ) ;
811+ var expectedDecision = new FeatureDecision ( experiment , variation , FeatureDecision . DECISION_SOURCE_EXPERIMENT ) ;
812812 var userAttributes = new UserAttributes {
813813 { "browser_type" , "chrome" }
814814 } ;
@@ -822,7 +822,7 @@ public void TestGetVariationForFeatureWhenTheUserIsBuckedtedInBothExperimentAndR
822822 var rollout = ProjectConfig . GetRolloutFromId ( featureFlag . RolloutId ) ;
823823 var rolloutExperiment = rollout . Experiments [ 0 ] ;
824824 var rolloutVariation = rolloutExperiment . Variations [ 0 ] ;
825- var expectedRolloutDecision = new FeatureDecision ( rolloutExperiment . Id , rolloutVariation . Id , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
825+ var expectedRolloutDecision = new FeatureDecision ( rolloutExperiment , rolloutVariation , FeatureDecision . DECISION_SOURCE_ROLLOUT ) ;
826826
827827 BucketerMock . Setup ( bm => bm . Bucket ( ProjectConfig , rolloutExperiment , It . IsAny < string > ( ) , It . IsAny < string > ( ) ) ) . Returns ( rolloutVariation ) ;
828828 var actualRolloutDecision = DecisionServiceMock . Object . GetVariationForFeatureRollout ( featureFlag , "user1" , userAttributes ) ;
0 commit comments