Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions OptimizelySDK.Tests/OptimizelyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1811,39 +1811,6 @@ public void TestGetEnabledFeaturesWithSomeFeaturesEnabledForUser()
Array.ForEach(notEnabledFeatures, nef => CollectionAssert.DoesNotContain(actualFeaturesList, nef));
}

[Test]
public void TestGetEnabledFeaturesReturnsSortedList()
{
string[] unsortedFeaturesList =
{
"Double_single_variable_feature_ignorecase",
"double_single_variable_feature",
"boolean_feature",
"string_single_variable_feature",
"multi_variate_feature",
"empty_feature",
"boolean_single_variable_feature"
};
string[] sortedFeaturesList =
{
"boolean_feature",
"boolean_single_variable_feature",
"double_single_variable_feature",
//It must come first, if case-sensitive sorted otherwise should come at 4th place
"Double_single_variable_feature_ignorecase",
"empty_feature",
"multi_variate_feature",
"string_single_variable_feature",
};

OptimizelyMock.Setup(om => om.IsFeatureEnabled(It.IsIn<string>(unsortedFeaturesList), TestUserId,
It.IsAny<UserAttributes>())).Returns(true);

// Verify that returned list in sorterd in ascending order.
var actualFeaturesList = OptimizelyMock.Object.GetEnabledFeatures(TestUserId, null);
CollectionAssert.AreEqual(sortedFeaturesList, actualFeaturesList);
}

#endregion // Test GetEnabledFeatures
}
}
1 change: 0 additions & 1 deletion OptimizelySDK.Tests/ProjectConfigTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ public void TestInit()
{
{ "boolean_feature", Config.GetFeatureFlagFromKey("boolean_feature") },
{ "double_single_variable_feature", Config.GetFeatureFlagFromKey("double_single_variable_feature") },
{ "Double_single_variable_feature_ignorecase", Config.GetFeatureFlagFromKey("Double_single_variable_feature_ignorecase") },
{ "integer_single_variable_feature", Config.GetFeatureFlagFromKey("integer_single_variable_feature") },
{ "boolean_single_variable_feature", Config.GetFeatureFlagFromKey("boolean_single_variable_feature") },
{ "string_single_variable_feature", Config.GetFeatureFlagFromKey("string_single_variable_feature") },
Expand Down
13 changes: 1 addition & 12 deletions OptimizelySDK.Tests/TestData.json
Original file line number Diff line number Diff line change
Expand Up @@ -434,18 +434,7 @@
"rolloutId": "",
"experimentIds": ["7723330021", "7718750065"],
"variables": []
},
{
"id": "1555892",
"key": "Double_single_variable_feature_ignorecase",
"rolloutId": "",
"experimentIds": [
"7723330021",
"7718750065"
],
"variables": []
},
{
}, {
"id": "155550",
"key": "double_single_variable_feature",
"rolloutId": "",
Expand Down
1 change: 0 additions & 1 deletion OptimizelySDK/Optimizely.cs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ public List<string> GetEnabledFeatures(string userId, UserAttributes userAttribu
enabledFeaturesList.Add(featureKey);
}

enabledFeaturesList.Sort(StringComparer.OrdinalIgnoreCase);
return enabledFeaturesList;
}

Expand Down