public void Test()
        {
            try
            {
                List <Record> rowList = new List <Record>();

                List <user_field> user_fields = new List <user_field>();
                user_field        userfield   = new user_field {
                    name = "email", value = "*****@*****.**"
                };
                user_fields.Add(userfield);

                rowList.Add(new Record(user_fields, firstname: "migual", lastname: "batista"));
                List <user_field> user_fieldsample = new List <user_field>();
                rowList.Add(new Record(null, addressline1: "701 Pine Drift Dr", name: "John Smith", country: "usa"));

                input input = new input();
                input.RecordList = rowList;

                CheckGlobalWatchListAPIRequest  request  = new CheckGlobalWatchListAPIRequest(input);
                CheckGlobalWatchListAPIResponse response = identifyRiskService.CheckGlobalWatchList(request);

                Assert.IsInstanceOfType(response, typeof(CheckGlobalWatchListAPIResponse));
                string output = Utility.ObjectToJson <CheckGlobalWatchListAPIResponse>(response);
                Debug.WriteLine(output);
            }
            catch (Exception e)
            {
                Assert.Fail("Unexpected Exception");
            }
        }
Example #2
0
        /// <summary>
        /// Matches the input record request in asynchronous mode.
        /// Response can be retrieved by subscribing to event IdentifyAPIRequestFinishedEvent.
        /// Accepts the record request as input and returns matched records
        /// </summary>
        /// <param name="request">Required - CheckGlobalWatchListAPIRequest request (object filled with input and option) </param>
        public void CheckGlobalWatchListAsync(CheckGlobalWatchListAPIRequest request)
        {
            UrlMaker      urlMaker   = UrlMaker.getInstance();
            StringBuilder urlBuilder = new StringBuilder(urlMaker.getAbsoluteUrl(identifyRiskUrl));
            string        url        = urlBuilder.ToString() + checkGlobalWatchListUrl;

            String requestString = Utility.ObjectToJson <CheckGlobalWatchListAPIRequest>(request);
            processAPIRequestDelegate <CheckGlobalWatchListAPIResponse> delegateApiRequest = new processAPIRequestDelegate <CheckGlobalWatchListAPIResponse>(Utility.processAPIRequest <CheckGlobalWatchListAPIResponse>);

            delegateApiRequest.BeginInvoke(url, requestString, new AsyncCallback(WorkflowCompletedCallbackCheckGlobalWatchList), null);
        }
Example #3
0
        /// <summary>
        /// Matches the input record request.
        /// Accepts the record request as input and returns matched records
        /// </summary>
        /// <param name="request">Required - CheckGlobalWatchListAPIRequest request (object filled with input and option) </param>
        /// <returns>CheckGlobalWatchListAPIResponse</returns>
        public CheckGlobalWatchListAPIResponse CheckGlobalWatchList(CheckGlobalWatchListAPIRequest request)
        {
            UrlMaker      urlMaker   = UrlMaker.getInstance();
            StringBuilder urlBuilder = new StringBuilder(urlMaker.getAbsoluteUrl(identifyRiskUrl));
            string        url        = urlBuilder.ToString() + checkGlobalWatchListUrl;


            String requestString = Utility.ObjectToJson <CheckGlobalWatchListAPIRequest>(request);

            return(Utility.processAPIRequest <CheckGlobalWatchListAPIResponse>(url, requestString));
        }
        public void TestAsync()
        {
            try
            {
                Boolean failFlag = false;
                this.TriggerTest = new AutoResetEvent(false);
                identifyRiskService.IdentifyAPIRequestFinishedEvent += (object sender, WebResponseEventArgs <CheckGlobalWatchListAPIResponse> eventArgs) =>
                {
                    try
                    {
                        Assert.IsTrue(eventArgs.ResponseObject != null);
                        this.TriggerTest.Set();
                    }
                    catch (Exception)
                    {
                        failFlag = true;
                        this.TriggerTest.Set();
                    }
                };

                List <Record> rowList = new List <Record>();

                List <user_field> user_fields = new List <user_field>();
                user_field        userfield   = new user_field {
                    name = "email", value = "*****@*****.**"
                };
                user_fields.Add(userfield);

                rowList.Add(new Record(user_fields, firstname: "migual", lastname: "batista"));

                List <user_field> user_fieldsample = new List <user_field>();
                rowList.Add(new Record(null, addressline1: "701 Pine Drift Dr", name: "John Smith", country: "usa"));

                input input = new input();
                input.RecordList = rowList;

                CheckGlobalWatchListAPIRequest request = new CheckGlobalWatchListAPIRequest(input);
                identifyRiskService.CheckGlobalWatchListAsync(request);

                this.TriggerTest.WaitOne(10000);
                if (failFlag)
                {
                    Assert.Fail("Test Case Failed");
                }
            }
            catch (Exception e)
            {
                Assert.Fail("Unexpected Exception");
            }
        }