示例#1
0
 public TaskCompletionSource <string> SyncIdentifier()
 {
     stringOutput = new TaskCompletionSource <string>();
     ACPIdentity.SyncIdentifier("name", "john", ACPMobileVisitorAuthenticationState.Authenticated);
     stringOutput.SetResult("completed");
     return(stringOutput);
 }
        public void TestGetIdentifiers_Returns_SyncedIdentifiers()
        {
            // setup
            latch = new CountdownEvent(1);
            ACPIdentity.SyncIdentifier("id1", "value1", VisitorID.AuthenticationState.Authenticated);
            var ids = new Dictionary <string, string>();

            ids.Add("id2", "value2");
            ids.Add("id3", "value3");
            ACPIdentity.SyncIdentifiers(ids);
            var ids2 = new Dictionary <string, string>();

            ids2.Add("id4", "value4");
            ids2.Add("id5", "value5");
            ACPIdentity.SyncIdentifiers(ids2, VisitorID.AuthenticationState.LoggedOut);
            // test
            ACPIdentity.GetIdentifiers(new GetIdentifiersCallback());
            latch.Wait();
            latch.Dispose();
            // verify
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value1, Type: id1, Origin: d_cid_ic, Authentication: AUTHENTICATED]"));
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value2, Type: id2, Origin: d_cid_ic, Authentication: UNKNOWN]"));
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value3, Type: id3, Origin: d_cid_ic, Authentication: UNKNOWN]"));
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value4, Type: id4, Origin: d_cid_ic, Authentication: LOGGED_OUT]"));
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value5, Type: id5, Origin: d_cid_ic, Authentication: LOGGED_OUT]"));
        }
示例#3
0
        public void TestGetIdentifiers_Returns_SyncedIdentifiers()
        {
            // setup
            CountdownEvent latch            = new CountdownEvent(1);
            string         visitorIdsString = "";

            ACPIdentity.SyncIdentifier("id1", "value1", ACPMobileVisitorAuthenticationState.Authenticated);
            var ids = new NSMutableDictionary <NSString, NSObject>
            {
                ["id2"] = new NSString("value2"),
                ["id3"] = new NSString("value3"),
            };

            ACPIdentity.SyncIdentifiers(ids);
            var ids2 = new NSMutableDictionary <NSString, NSObject>
            {
                ["id4"] = new NSString("value4"),
                ["id5"] = new NSString("value5"),
            };

            ACPIdentity.SyncIdentifiers(ids2, ACPMobileVisitorAuthenticationState.LoggedOut);
            // test
            ACPIdentity.GetIdentifiers(callback => {
                foreach (ACPMobileVisitorId id in callback)
                {
                    visitorIdsString = visitorIdsString + "[Id: " + id.Identifier + ", Type: " + id.IdType + ", Origin: " + id.IdOrigin + ", Authentication: " + id.AuthenticationState + "]";
                }
                latch.Signal();
            });
            latch.Wait();
            latch.Dispose();
            // verify
            Assert.That(visitorIdsString, Is.StringContaining("[Id: value1, Type: id1, Origin: d_cid_ic, Authentication: Authenticated]"));
            Assert.That(visitorIdsString, Is.StringContaining("[Id: value2, Type: id2, Origin: d_cid_ic, Authentication: Unknown]"));
            Assert.That(visitorIdsString, Is.StringContaining("[Id: value3, Type: id3, Origin: d_cid_ic, Authentication: Unknown]"));
            Assert.That(visitorIdsString, Is.StringContaining("[Id: value4, Type: id4, Origin: d_cid_ic, Authentication: LoggedOut]"));
            Assert.That(visitorIdsString, Is.StringContaining("[Id: value5, Type: id5, Origin: d_cid_ic, Authentication: LoggedOut]"));
        }
示例#4
0
 partial void syncIdentifier(UIButton sender)
 {
     ACPIdentity.SyncIdentifier("name", "john", ACPMobileVisitorAuthenticationState.Authenticated);
     Console.WriteLine("SyncIdentifiers Completed");
 }
示例#5
0
 void syncIdentifier()
 {
     ACPIdentity.SyncIdentifier("idType1", "idValue1", ACPIdentity.ACPAuthenticationState.AUTHENTICATED);
 }