public void GenerateLicenseKey_withParam()
        {
            ClsReminder objReminder = new Models.ClsReminder();

            objReminder.EmailId    = "*****@*****.**";
            objReminder.ContactNum = "0099887766";
            string apikey = "addsd-sdfsdf_sdf";
            bool   result = ClsReminder.AuthorizeUser(apikey);

            // Assert
            Assert.AreEqual(true, result);
        }
 public ActionResult GenerateLicenseKey(ClsReminder objParamReminder)
 {
     try
     {
         bool   bCheck;
         string key_first = objParamReminder.ContactNum.Substring(6, 2);
         string key_mid   = objParamReminder.EmailId.Substring(0, objParamReminder.EmailId.IndexOf('@'));
         string key_last  = objParamReminder.ContactNum.Substring(0, 3);
         objParamReminder.ApiKey = key_first + "_" + key_mid + "-" + key_last;
         bCheck = ClsReminder.AuthorizeUser(objParamReminder.ApiKey);
         if (bCheck)
         {
             return(View("Api", objParamReminder));
         }
         else
         {
             return(Content("<script language='javascript' type='text/javascript'>alert('Reminder Added in your calendar'); window.location='http://travelreminder.azurewebsites.net/home/ApiServices'; </script>"));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }