Beispiel #1
0
        /// <summary>
        /// Execute GetUser API test case to retreive the PUID low and high of user.
        /// </summary>
        /// <param name="tableName">tableName denotes the name of method under testing</param>
        private void ExecuteGetUser(string tableName)
        {
            try
            {
                string serviceUrl = string.Empty;
                string msg        = string.Empty;
                string low        = string.Empty;
                string high       = string.Empty;

                if (this.ExecuteTest(tableName))
                {
                    serviceUrl   = this.Init(tableName);
                    this.mexists = Helper.GetMeExistInstance(serviceUrl);
                    this.mexists.GetUser(Helper.InCurrentUsername, Convert.ToInt32(Helper.InTimeout), out high, out low, out msg);
                    this.LogHttpTrace();
                    this.WriteToLog(msg, high, tableName);
                }
            }
            catch (Exception ex)
            {
                this.SetPassFail(tableName, Resources.Messages.msgFail);
                if (string.IsNullOrEmpty(Helper.AutomationDataProvider.Tables[tableName].Rows[0][Resources.Messages.xmlStrConsumedBy].ToString()))
                {
                    Helper.ResultStringContainer.AppendLine(ex.Message + Resources.Messages.ErrorEmptyConsumedBy);
                }
                else
                {
                    Helper.ResultStringContainer.AppendLine(ex.Message);
                }

                Helper.ResultStringContainer.AppendLine(Resources.Messages.msgFail);
            }

            Helper.ResultStringContainer.AppendLine(string.Empty);
        }
Beispiel #2
0
        /// <summary>
        /// Get an instance of MExists
        /// </summary>
        /// <param name="serviceUrl">The service URL.</param>
        /// <returns>returns the object of MExists</returns>
        public static PassportLookUpProxy.MExists.MExists GetMeExistInstance(string serviceUrl)
        {
            if (Helper.mexists == null)
            {
                Helper.mexists             = new PassportLookUpProxy.MExists.MExists();
                Helper.mexists.Url         = serviceUrl;
                Helper.mexists.Credentials = CredentialCache.DefaultNetworkCredentials;

                if (!string.IsNullOrEmpty(Helper.ProxyAddress))
                {
                    Helper.mexists.Proxy = new WebProxy(Helper.ProxyAddress, Helper.Port);
                }
            }

            return(Helper.mexists);
        }