public StartupConditionResult Check()
        {
            if (_pdfToolsLicensing.Apply())
            {
                return(StartupConditionResult.BuildSuccess());
            }

            var exitCode = (int)_pdfToolsLicensing.ExitCode;

            return(StartupConditionResult.BuildErrorWithMessage(exitCode, _translation.GetFormattedErrorWithLicensedComponentTranslation(exitCode), showMessage: true));
        }
Beispiel #2
0
        public void Check_ApplyLicensingFails_ReturnsFailedResult()
        {
            _pdfToolsLicensing.Apply().Returns(false);
            _pdfToolsLicensing.ExitCode = ExitCode.InvalidPdfToolsDocumentLicense;

            var result = _startUpCondition.Check();

            Assert.IsFalse(result.IsSuccessful, "IsSuccessful");
            var exitCode = (int)_pdfToolsLicensing.ExitCode;

            Assert.AreEqual(exitCode, result.ExitCode, "ExitCode");
            Assert.IsTrue(result.ShowMessage, "ShowMessage");
            Assert.AreEqual(_translation.GetFormattedErrorWithLicensedComponentTranslation(exitCode), _translation.GetFormattedErrorWithLicensedComponentTranslation(exitCode), "Message");
        }
Beispiel #3
0
        public StartupConditionResult Check()
        {
            var libPath = _assemblyHelper.GetAssemblyDirectory() + "\\lib\\";

            libPath += _osHelper.Is64BitProcess ? "x64" : "x86";
            _osHelper.AddDllDirectorySearchPath(libPath);

            if (_pdfToolsLicensing.Apply())
            {
                return(StartupConditionResult.BuildSuccess());
            }

            var exitCode = (int)_pdfToolsLicensing.ExitCode;

            return(StartupConditionResult.BuildErrorWithMessage(exitCode, _translation.GetFormattedErrorWithLicensedComponentTranslation(exitCode), showMessage: true));
        }