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]")); }
void syncIdentifiersWithAuthState() { Dictionary <string, string> ids = new Dictionary <string, string>(); ids.Add("idsType1", "idValue1"); ids.Add("idsType2", "idValue2"); ids.Add("idsType3", "idValue3"); ACPIdentity.SyncIdentifiers(ids, ACPIdentity.ACPAuthenticationState.AUTHENTICATED); }
void syncIdentifiers() { Dictionary <string, string> ids = new Dictionary <string, string>(); ids.Add("idsType1", "idValue1"); ids.Add("idsType2", "idValue2"); ids.Add("idsType3", "idValue3"); ACPIdentity.SyncIdentifiers(ids); }
partial void SyncIdentifiersWithAuthState(UIButton sender) { var ids = new NSMutableDictionary <NSString, NSObject> { ["lastName"] = new NSString("doe"), ["age"] = new NSString("38"), ["zipcode"] = new NSString("94403") }; ACPIdentity.SyncIdentifiers(ids, ACPMobileVisitorAuthenticationState.LoggedOut); Console.WriteLine("SyncIdentifiersWithAuthState Completed"); }
partial void SyncIdentifiers(UIButton sender) { var ids = new NSMutableDictionary <NSString, NSObject> { ["lastName"] = new NSString("doe"), ["age"] = new NSString("38"), ["zipcode"] = new NSString("94403") }; ACPIdentity.SyncIdentifiers(ids); Console.WriteLine("SyncIdentifiers Completed"); }
public TaskCompletionSource <string> SyncIdentifiersWithAuthState() { stringOutput = new TaskCompletionSource <string>(); var ids = new Dictionary <string, string>(); ids.Add("lastname", "doe"); ids.Add("age", "38"); ids.Add("zipcode", "94403"); ACPIdentity.SyncIdentifiers(ids, VisitorID.AuthenticationState.LoggedOut); stringOutput.SetResult("completed"); return(stringOutput); }
public TaskCompletionSource <string> SyncIdentifiers() { stringOutput = new TaskCompletionSource <string>(); var ids = new Dictionary <string, string>(); ids.Add("lastname", "doe"); ids.Add("age", "38"); ids.Add("zipcode", "94403"); ACPIdentity.SyncIdentifiers(ids); stringOutput.SetResult("completed"); return(stringOutput); }
public TaskCompletionSource <string> SyncIdentifiersWithAuthState() { stringOutput = new TaskCompletionSource <string>(); var ids = new NSMutableDictionary <NSString, NSObject> { ["lastName"] = new NSString("doe"), ["age"] = new NSString("38"), ["zipcode"] = new NSString("94403") }; ACPIdentity.SyncIdentifiers(ids, ACPMobileVisitorAuthenticationState.LoggedOut); stringOutput.SetResult("completed"); return(stringOutput); }
public TaskCompletionSource <string> SyncIdentifiers() { stringOutput = new TaskCompletionSource <string>(); var ids = new NSMutableDictionary <NSString, NSObject> { ["lastName"] = new NSString("doe"), ["age"] = new NSString("38"), ["zipcode"] = new NSString("94403") }; ACPIdentity.SyncIdentifiers(ids); stringOutput.SetResult("completed"); return(stringOutput); }
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]")); }