public void UpdateUserAttributes_Then_RemoveUserAttributes_Returns_ExpectedAttributes()
        {
            // setup
            latch = new CountdownEvent(1);
            // test
            var attributes = new Dictionary <string, Java.Lang.Object>();

            attributes.Add("key1", "value1");
            attributes.Add("key2", "value2");
            attributes.Add("key3", "value3");
            attributes.Add("key4", "value4");
            ACPUserProfile.UpdateUserAttributes(attributes);
            var keysToRemove = new List <string>();

            keysToRemove.Add("key1");
            keysToRemove.Add("key3");
            ACPUserProfile.RemoveUserAttributes(keysToRemove);
            var keysToRetrieve = new List <string>();

            keysToRetrieve.Add("key1");
            keysToRetrieve.Add("key2");
            keysToRetrieve.Add("key3");
            keysToRetrieve.Add("key4");
            ACPUserProfile.GetUserAttributes(keysToRetrieve, new AdobeCallback());
            latch.Wait(1000);
            // verify
            Assert.That(callbackString.Contains("[ key2 : value2 ]"));
            Assert.That(callbackString.Contains("[ key4 : value4 ]"));
        }
Example #2
0
    void UpdateUserAttributes()
    {
        Debug.Log("Calling UpdateUserAttributes");
        var dict = new Dictionary <string, object>();

        dict.Add("mapKey", "mapValue");
        dict.Add("mapKey1", "mapValue1");
        ACPUserProfile.UpdateUserAttributes(dict);
    }
        public TaskCompletionSource <string> UpdateUserAttributes()
        {
            stringOutput = new TaskCompletionSource <string>();
            var attributes = new Dictionary <string, Java.Lang.Object>();

            attributes.Add("firstName", "jane");
            attributes.Add("lastName", "doe");
            attributes.Add("vehicle", "sedan");
            attributes.Add("color", "red");
            attributes.Add("insured", true);
            attributes.Add("age", 21);
            ACPUserProfile.UpdateUserAttributes(attributes);
            stringOutput.SetResult("complete");
            GetUserAttributes();
            return(stringOutput);
        }
Example #4
0
        public TaskCompletionSource <string> UpdateUserAttributes()
        {
            stringOutput = new TaskCompletionSource <string>();
            var attributes = new NSMutableDictionary <NSString, NSString>
            {
                ["firstName"] = new NSString("jane"),
                ["lastName"]  = new NSString("doe"),
                ["vehicle"]   = new NSString("sedan"),
                ["color"]     = new NSString("red"),
                ["insured"]   = new NSString("true"),
                ["age"]       = new NSString("21")
            };

            ACPUserProfile.UpdateUserAttributes(attributes);
            stringOutput.SetResult("complete");
            GetUserAttributes();
            return(stringOutput);
        }
Example #5
0
        public void UpdateUserAttributes_Then_GetUserAttributes_Returns_ExpectedAttributes()
        {
            // setup
            latch = new CountdownEvent(1);
            // test
            var attributes = new NSMutableDictionary <NSString, NSString>
            {
                ["key1"] = new NSString("value1"),
                ["key2"] = new NSString("value2")
            };

            ACPUserProfile.UpdateUserAttributes(attributes);
            string[] attributeKeys = new string[] { "key1", "key2" };
            ACPUserProfile.GetUserAttributes(attributeKeys, callback);
            latch.Wait(1000);
            // verify
            Assert.That(callbackString.Contains("[ key1 : value1 ]"));
            Assert.That(callbackString.Contains("[ key2 : value2 ]"));
        }
        public void UpdateUserAttributes_Then_RemoveUserAttribute_Returns_ExpectedAttributes()
        {
            // setup
            latch = new CountdownEvent(1);
            // test
            var attributes = new Dictionary <string, Java.Lang.Object>();

            attributes.Add("key1", "value1");
            attributes.Add("key2", "value2");
            ACPUserProfile.UpdateUserAttributes(attributes);
            ACPUserProfile.RemoveUserAttribute("key1");
            var attributeKeys = new List <string>();

            attributeKeys.Add("key1");
            attributeKeys.Add("key2");
            ACPUserProfile.GetUserAttributes(attributeKeys, new AdobeCallback());
            latch.Wait(1000);
            // verify
            Assert.That(callbackString, Is.EqualTo("[ key2 : value2 ]"));
        }