public void OptimizelyUserContextNoAttributes()
        {
            OptimizelyUserContext user = new OptimizelyUserContext(Optimizely, UserID, null, ErrorHandlerMock.Object, LoggerMock.Object);

            Assert.AreEqual(user.GetOptimizely(), Optimizely);
            Assert.AreEqual(user.GetUserId(), UserID);
            Assert.True(user.GetAttributes().Count == 0);
        }
        public void OptimizelyUserContextWithAttributes()
        {
            var attributes = new UserAttributes()
            {
                { "house", "GRYFFINDOR" }
            };
            OptimizelyUserContext user = new OptimizelyUserContext(Optimizely, UserID, attributes, ErrorHandlerMock.Object, LoggerMock.Object);

            Assert.AreEqual(user.GetOptimizely(), Optimizely);
            Assert.AreEqual(user.GetUserId(), UserID);
            Assert.AreEqual(user.GetAttributes(), attributes);
        }
        public void SetAttributeToOverrideAttribute()
        {
            OptimizelyUserContext user = new OptimizelyUserContext(Optimizely, UserID, null, ErrorHandlerMock.Object, LoggerMock.Object);

            Assert.AreEqual(user.GetOptimizely(), Optimizely);
            Assert.AreEqual(user.GetUserId(), UserID);

            user.SetAttribute("k1", "v1");
            Assert.AreEqual(user.GetAttributes()["k1"], "v1");

            user.SetAttribute("k1", true);
            Assert.AreEqual(user.GetAttributes()["k1"], true);
        }
        public void SetAttribute()
        {
            var attributes = new UserAttributes()
            {
                { "house", "GRYFFINDOR" }
            };
            OptimizelyUserContext user = new OptimizelyUserContext(Optimizely, UserID, attributes, ErrorHandlerMock.Object, LoggerMock.Object);

            user.SetAttribute("k1", "v1");
            user.SetAttribute("k2", true);
            user.SetAttribute("k3", 100);
            user.SetAttribute("k4", 3.5);

            Assert.AreEqual(user.GetOptimizely(), Optimizely);
            Assert.AreEqual(user.GetUserId(), UserID);
            var newAttributes = user.GetAttributes();

            Assert.AreEqual(newAttributes["house"], "GRYFFINDOR");
            Assert.AreEqual(newAttributes["k1"], "v1");
            Assert.AreEqual(newAttributes["k2"], true);
            Assert.AreEqual(newAttributes["k3"], 100);
            Assert.AreEqual(newAttributes["k4"], 3.5);
        }