Exemple #1
0
 public Response <License> Post(LicenseRequest request)
 {
     try
     {
         License license = LicenseDAL.GetNewLicense(request.User, request.ApplicationID);
         return(new Response <License>(license));
     }
     catch (Exception ex)
     {
         return(new Response <License>(ex.Message));
     }
 }
        public void GetAuthorizationKeyTest()
        {
            User user = new User()
            {
                Address      = "Address",
                City         = "City",
                EmailAddress = "EmailAddress",
                Name         = "GetAuthorizationKeyTestMethod",
                PhoneNumber  = "PhoneNumber",
                State        = "State",
                Zip          = "Zip"
            };

            string  hardwareID = "HardwareID";
            Guid    guid       = new Guid("5FD3560A-0EFD-4E48-9DF9-C4FA3F44BA15");
            License license    = LicenseDAL.GetNewLicense(user, guid);

            string authKey = GetAuthorizationKey(hardwareID, guid, license.Key);

            Assert.AreEqual(Registration.GenerateSHA1Hash(string.Concat(hardwareID, guid.ToString(), license.Key)), authKey);
        }
 public License RequestLicense(User user, Guid applicationID)
 {
     return(LicenseDAL.GetNewLicense(user, applicationID));
 }