From a6abb608d78a963062a9d31a272271af2d7e814a Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Tue, 5 Nov 2024 17:32:48 -0500 Subject: [PATCH] revert: modifiers on DecisionService & test changes --- OptimizelySDK.Tests/DecisionServiceTest.cs | 6 +++++- OptimizelySDK/Bucketing/DecisionService.cs | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OptimizelySDK.Tests/DecisionServiceTest.cs b/OptimizelySDK.Tests/DecisionServiceTest.cs index d1bf15af..8fbedf23 100644 --- a/OptimizelySDK.Tests/DecisionServiceTest.cs +++ b/OptimizelySDK.Tests/DecisionServiceTest.cs @@ -160,8 +160,12 @@ public void TestGetVariationLogsErrorWhenUserProfileMapItsNull() var variationResult = decisionService.GetVariation(experiment, OptimizelyUserContextMock.Object, ProjectConfig, options); Assert.AreEqual(variationResult.DecisionReasons.ToReport(true)[0], - "Audiences for experiment \"etag3\" collectively evaluated to FALSE"); + "We were unable to get a user profile map from the UserProfileService."); Assert.AreEqual(variationResult.DecisionReasons.ToReport(true)[1], + "No previously activated variation of experiment \"etag3\" for user \"genericUserId\" found in user profile."); + Assert.AreEqual(variationResult.DecisionReasons.ToReport(true)[2], + "Audiences for experiment \"etag3\" collectively evaluated to FALSE"); + Assert.AreEqual(variationResult.DecisionReasons.ToReport(true)[3], "User \"genericUserId\" does not meet conditions to be in experiment \"etag3\"."); } diff --git a/OptimizelySDK/Bucketing/DecisionService.cs b/OptimizelySDK/Bucketing/DecisionService.cs index f001da69..1e364b29 100644 --- a/OptimizelySDK/Bucketing/DecisionService.cs +++ b/OptimizelySDK/Bucketing/DecisionService.cs @@ -41,9 +41,9 @@ public class DecisionService public const string LOGGING_KEY_TYPE_RULE = "rule"; private Bucketer Bucketer; - private readonly IErrorHandler ErrorHandler; - private static UserProfileService UserProfileService; - private readonly ILogger Logger; + private IErrorHandler ErrorHandler; + private UserProfileService UserProfileService; + private ILogger Logger; /// /// Associative array of user IDs to an associative array