Пример #1
0
        public async void Test_DeleteLicenses(string strKeyId, string strEncryptionType, string strExpectedError)
        {
            TestLogger.LogMessage("Enter Test_DeleteLicenses()");

            strExpectedError = ActionParamConvertToString(strExpectedError);
            bool bTestActionResult = true;

            try
            {
                Guid keyIdGuid = ActionParamConvertToGuid(strKeyId);
                PlayReadyEncryptionAlgorithm alg = ActionParamConvertToPlayReadyEncryptionAlgorithm(strEncryptionType);
                await LicenseManagement.DeleteLicenses(keyIdGuid, string.Empty, alg);
            }
            catch (Exception ex)
            {
                TestLogger.LogMessage("Test_DeleteLicenses Exception = " + ex.Message);
                if (strExpectedError != null && ex.Message.ToLower().Contains(strExpectedError.ToLower()))
                {
                    TestLogger.LogMessage("'" + ex.Message + "' Contains " + strExpectedError + "  as expected");
                    bTestActionResult = true;
                }
                else
                {
                    bTestActionResult = false;
                }
            }

            TestLogger.LogMessage("Leave Test_DeleteLicenses()");
            TestActionFinished(bTestActionResult, null);
        }
Пример #2
0
 void VerifyLicensesShouldExist(Guid keyIdGuid, bool bFullyEvaluated, uint?uintCount)
 {
     IPlayReadyLicense[] licenses = LicenseManagement.FindMultipleLicenses(keyIdGuid, string.Empty, bFullyEvaluated);
     if (licenses == null)
     {
         TestLogger.LogMessage("Licenses not found!!!");
         TestActionFinished(false, null);
     }
     else
     {
         if (!uintCount.HasValue)
         {
             TestActionFinished(true, null);
         }
         else
         {
             if (licenses.Length == uintCount.Value)
             {
                 TestLogger.LogMessage("License count matched!!!");
                 TestActionFinished(true, null);
             }
             else
             {
                 TestLogger.LogMessage("License count not matching!!!");
                 TestActionFinished(false, null);
             }
         }
     }
 }
Пример #3
0
 void VerifyLicensesShouldNotExist(Guid keyIdGuid, bool bFullyEvaluated)
 {
     IPlayReadyLicense[] licenses = LicenseManagement.FindMultipleLicenses(keyIdGuid, string.Empty, bFullyEvaluated);
     if (licenses == null)
     {
         TestLogger.LogMessage("Licenses not found!!!");
         TestActionFinished(true, null);
     }
     else
     {
         TestLogger.LogMessage("Licenses found. Count = " + licenses.Length);
         TestActionFinished(false, null);
     }
 }
Пример #4
0
        void VerifyLicenseShouldNotExist(Guid keyIdGuid, string strKeyIdString, bool bFullyEvaluated)
        {
            PlayReadyLicense license = LicenseManagement.FindSingleLicense(keyIdGuid, strKeyIdString, bFullyEvaluated);

            if (license == null)
            {
                TestLogger.LogMessage("License not found!!!");
                TestActionFinished(true, null);
            }
            else
            {
                TestLogger.LogMessage("License found!!!");
                TestActionFinished(false, null);
            }
        }
Пример #5
0
        void VerifyLicenseShouldExist(Guid keyIdGuid, string strKeyIdString, bool bFullyEvaluated)
        {
            PlayReadyLicense license = LicenseManagement.FindSingleLicense(keyIdGuid, strKeyIdString, bFullyEvaluated);

            if (license == null)
            {
                TestLogger.LogMessage("License not found!!!");
                TestActionFinished(false, null);
            }
            else
            {
                Guid keyIdFromLicense = license.GetKIDAtChainDepth(0);
                if (keyIdFromLicense == keyIdGuid || keyIdFromLicense == new Guid(System.Convert.FromBase64String(strKeyIdString)))
                {
                    TestLogger.LogMessage("Matching license found in license store!!!");
                    TestActionFinished(true, null);
                }
                else
                {
                    TestLogger.LogMessage("Matching license not found in license store!!!");
                    TestActionFinished(false, null);
                }
            }
        }