-
Notifications
You must be signed in to change notification settings - Fork 20
Feature toggleability #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can one of the admins verify this patch? |
build |
@@ -317,6 +317,10 @@ public void TestInit() | |||
}; | |||
|
|||
Assert.IsTrue(TestData.CompareObjects(expectedRolloutIdMap, Config.RolloutIdMap)); | |||
|
|||
// Verify that featureEnabled property of variation is false if not defined. | |||
var variation = new Variation { Id = "test_experiment", Key = "control" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please separate out into its own test case
OptimizelySDK.Tests/TestData.json
Outdated
@@ -16,11 +16,13 @@ | |||
"audienceIds": ["7718080042"], | |||
"variations": [{ | |||
"id": "7722370027", | |||
"key": "control" | |||
"key": "control", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these feature experiments? We should only be adding it to variations that belong to experiments that have a feature attached to them.
OptimizelySDK/Optimizely.cs
Outdated
@@ -355,21 +355,16 @@ public virtual bool IsFeatureEnabled(string featureKey, string userId, UserAttri | |||
return false; | |||
|
|||
var decision = DecisionService.GetVariationForFeature(featureFlag, userId, userAttributes); | |||
if (decision == null) | |||
if (decision == null || !decision.Variation.FeatureEnabled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you null-check the Variation as well
separate test case as per suggestion.
build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.