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