protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); LoadApplication(new App()); // set the wrapper type ACPCore.SetWrapperType(WrapperType.Xamarin); // set log level ACPCore.LogLevel = LoggingMode.Verbose; // set application ACPCore.Application = this.Application; // register SDK extensions ACPUserProfile.RegisterExtension(); // start core ACPCore.Start(new CoreStartCompletionCallback()); // register dependency service to link interface from ACPGriffonTestApp base project DependencyService.Register <IACPUserProfileExtensionService, ACPUserProfileExtensionService>(); }
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 ]")); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); runner = new TouchRunner(window); // register every tests included in the main application/assembly runner.Add(System.Reflection.Assembly.GetExecutingAssembly()); window.RootViewController = new UINavigationController(runner.GetViewController()); // make the window visible window.MakeKeyAndVisible(); // setup for all tests CountdownEvent latch = new CountdownEvent(1); ACPCore.LogLevel = ACPMobileLogLevel.Verbose; ACPUserProfile.RegisterExtension(); // start core ACPCore.Start(() => { ACPCore.ConfigureWithAppID("94f571f308d5/00fc543a60e1/launch-c861fab912f7-development"); latch.Signal(); }); latch.Wait(); latch.Dispose(); return(true); }
public TaskCompletionSource <string> UpdateUserAttribute() { stringOutput = new TaskCompletionSource <string>(); ACPUserProfile.UpdateUserAttribute("firstName", "john"); stringOutput.SetResult("completed"); GetUserAttributes(); return(stringOutput); }
void UserProfileExtensionVersion() { Debug.Log("Calling User Profile extensionVersion"); string UserProfileExtensionVersion = ACPUserProfile.ExtensionVersion(); Debug.Log("UserProfile extension version : " + UserProfileExtensionVersion); results = "UserProfile extension version : " + UserProfileExtensionVersion; }
public TaskCompletionSource <string> RemoveUserAttribute() { stringOutput = new TaskCompletionSource <string>(); ACPUserProfile.RemoveUserAttribute("lastName"); stringOutput.SetResult("completed"); GetUserAttributes(); return(stringOutput); }
void UpdateUserAttributes() { Debug.Log("Calling UpdateUserAttributes"); var dict = new Dictionary <string, object>(); dict.Add("mapKey", "mapValue"); dict.Add("mapKey1", "mapValue1"); ACPUserProfile.UpdateUserAttributes(dict); }
void GetUserAttributes() { Debug.Log("Calling GetUserAttributes"); var attributeKeys = new List <string>(); attributeKeys.Add("attrNameTest"); attributeKeys.Add("mapKey"); ACPUserProfile.GetUserAttributes(attributeKeys, HandleAdobeGetUserAttributesCallback); }
void RemoveUserAttributes() { Debug.Log("Calling RemoveUserAttributes"); var attributeKeys = new List <string>(); attributeKeys.Add("attrNameTest"); attributeKeys.Add("mapKey"); ACPUserProfile.RemoveUserAttributes(attributeKeys); }
public TaskCompletionSource <string> RemoveUserAttributes() { stringOutput = new TaskCompletionSource <string>(); string[] attributes = new string[] { "vehicle", "color" }; ACPUserProfile.RemoveUserAttributes(attributes); stringOutput.SetResult("completed"); GetUserAttributes(); return(stringOutput); }
public TaskCompletionSource <string> RemoveUserAttributes() { stringOutput = new TaskCompletionSource <string>(); var attributes = new List <string>(); attributes.Add("vehicle"); attributes.Add("color"); ACPUserProfile.RemoveUserAttributes(attributes); stringOutput.SetResult("completed"); GetUserAttributes(); return(stringOutput); }
public void UpdateUserAttribute_Then_GetUserAttributes_Returns_ExpectedAttributes() { // setup latch = new CountdownEvent(1); // test ACPUserProfile.UpdateUserAttribute("key", "value"); string[] attributes = new string[] { "key" }; ACPUserProfile.GetUserAttributes(attributes, callback); latch.Wait(1000); // verify Assert.That(callbackString, Is.EqualTo("[ key : value ]")); }
public void UpdateUserAttribute_Then_GetUserAttributes_Returns_ExpectedAttributes() { // setup latch = new CountdownEvent(1); // test ACPUserProfile.UpdateUserAttribute("key", "value"); var attributes = new List <string>(); attributes.Add("key"); ACPUserProfile.GetUserAttributes(attributes, new AdobeCallback()); latch.Wait(1000); // verify Assert.That(callbackString, Is.EqualTo("[ key : value ]")); }
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); }
public TaskCompletionSource <string> GetUserAttributes() { latch = new CountdownEvent(1); stringOutput = new TaskCompletionSource <string>(); var attributes = new List <string>(); attributes.Add("firstName"); attributes.Add("lastName"); attributes.Add("vehicle"); attributes.Add("color"); attributes.Add("insured"); attributes.Add("age"); ACPUserProfile.GetUserAttributes(attributes, new AdobeCallback()); latch.Wait(1000); latch.Dispose(); stringOutput.SetResult(callbackString); return(stringOutput); }
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); }
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 ]")); }
protected override void OnCreate(Bundle bundle) { // tests can be inside the main assembly AddTest(Assembly.GetExecutingAssembly()); // or in any reference assemblies // AddTest (typeof (Your.Library.TestClass).Assembly); // Once you called base.OnCreate(), you cannot add more assemblies. base.OnCreate(bundle); // setup for all tests ACPCore.Application = this.Application; ACPCore.SetWrapperType(WrapperType.Xamarin); ACPCore.LogLevel = LoggingMode.Verbose; ACPUserProfile.RegisterExtension(); // start core ACPCore.Start(new CoreStartCompletionCallback()); latch.Wait(); latch.Dispose(); }
public TaskCompletionSource <string> GetUserAttributes() { latch = new CountdownEvent(1); stringOutput = new TaskCompletionSource <string>(); Action <NSDictionary, NSError> callback = (content, error) => { callbackString = ""; if (error != null) { string message = "GetUserAttributes error:" + error.DebugDescription; Console.WriteLine(message); callbackString = message; } else if (content == null) { string message = "GetUserAttributes callback is null."; Console.WriteLine(message); callbackString = message; } else { foreach (KeyValuePair <NSObject, NSObject> pair in content) { callbackString = callbackString + "[ " + pair.Key + ": " + pair.Value + " ]"; } Console.WriteLine("Retrieved attributes: " + callbackString); } if (latch != null) { latch.Signal(); } }; string[] attributes = new string[] { "firstName", "lastName", "vehicle", "color", "insured", "age" }; ACPUserProfile.GetUserAttributes(attributes, callback); latch.Wait(1000); latch.Dispose(); stringOutput.SetResult(callbackString); return(stringOutput); }
void Start() { if (Application.platform == RuntimePlatform.Android) { ACPCore.SetApplication(); } ACPCore.SetLogLevel(ACPCore.ACPMobileLogLevel.VERBOSE); ACPCore.SetWrapperType(); ACPIdentity.RegisterExtension(); ACPUserProfile.RegisterExtension(); ACPCore.Start(HandleStartAdobeCallback); var callbackResultsGameObject = GameObject.Find("CallbackResults"); callbackResultsText = callbackResultsGameObject.GetComponent <Text>(); btnExtensionVersion.onClick.AddListener(UserProfileExtensionVersion); btnGetUserAttributes.onClick.AddListener(GetUserAttributes); btnRemoveUserAttribute.onClick.AddListener(RemoveUserAttribute); btnRemoveUserAttributes.onClick.AddListener(RemoveUserAttributes); btnUpdateUserAttribute.onClick.AddListener(UpdateUserAttribute); btnUpdateUserAttributes.onClick.AddListener(UpdateUserAttributes); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); // set the wrapper type ACPCore.SetWrapperType(ACPMobileWrapperType.Xamarin); // set log level ACPCore.LogLevel = ACPMobileLogLevel.Verbose; // register SDK extensions ACPLifecycle.RegisterExtension(); ACPIdentity.RegisterExtension(); ACPUserProfile.RegisterExtension(); // start core ACPCore.Start(startCallback); // register dependency service to link interface from ACPCoreTestApp base project DependencyService.Register <IACPUserProfileExtensionService, ACPUserProfileExtensionService>(); return(base.FinishedLaunching(app, options)); }
void RemoveUserAttribute() { Debug.Log("Calling RemoveUserAttribute"); ACPUserProfile.RemoveUserAttribute("attrNameTest"); }
// ACPUserProfile methods public TaskCompletionSource <string> GetExtensionVersionUserProfile() { stringOutput = new TaskCompletionSource <string>(); stringOutput.SetResult(ACPUserProfile.ExtensionVersion()); return(stringOutput); }
public void GetACPUserProfileExtensionVersion_Returns_CorrectVersion() { // verify Assert.That(ACPUserProfile.ExtensionVersion(), Is.EqualTo("1.1.0")); }
void UpdateUserAttribute() { Debug.Log("Calling UpdateUserAttribute"); ACPUserProfile.UpdateUserAttribute("attrNameTest", "attrValueTest"); }