Esempio n. 1
0
        public void TestSetUserAttributes()
        {
            PersistenceManager persistenceManager = new PersistenceManager(MParticleOptions.Builder("foo", "bar").Build());

            persistenceManager.Initialize(Package.Current.Id.Version);
            var user = new MParticleUser(5, persistenceManager);

            user.UserAttribute("foo attribute key", "foo value");
            Assert.AreEqual("foo value", user.UserAttributes["foo attribute key"]);
        }
Esempio n. 2
0
        public void TestSetUserAttributeList()
        {
            PersistenceManager persistenceManager = new PersistenceManager(MParticleOptions.Builder("foo", "bar").Build());

            persistenceManager.Initialize(Package.Current.Id.Version);
            var user = new MParticleUser(5, persistenceManager);
            var attributeValueList = new List <string>();

            attributeValueList.Add("foo item 1");
            user.UserAttribute("foo attribute list key", attributeValueList);
            Assert.AreEqual("foo item 1", ((IList <string>)user.UserAttributes["foo attribute list key"])[0]);
        }