예제 #1
0
        public void WithInvalidLicense_AndLicenseManagementDisabledViaGpo_GivesCorrectExitCode()
        {
            _gpoSettings.HideLicenseTab.Returns(true);
            _activationHelper.LicenseStatus.Returns(LicenseStatus.NoLicense);

            var licenseCondition = BuildCheckLicenseConditions();

            var result = licenseCondition.Check();

            Assert.IsFalse(_interactionInvoker.ReceivedCalls().Any());
            Assert.AreEqual((int)ExitCode.LicenseInvalidAndHiddenWithGpo, result.ExitCode);
        }
예제 #2
0
        public void WithInvalidLicense_AndLicenseManagementDisabledViaGpo_ResultIsNotSuccesfullWithCorrespondingErrorAndWithoutInteraction()
        {
            _savedActivation = null;
            _gpoSettings.HideLicenseTab.Returns(true);

            var licenseCondition = BuildCheckLicenseConditions();

            var result = licenseCondition.Check();

            Assert.IsFalse(result.IsSuccessful);
            Assert.IsFalse(_interactionInvoker.ReceivedCalls().Any());
            Assert.AreEqual((int)ExitCode.LicenseInvalidAndHiddenWithGpo, result.ExitCode);
            Assert.AreEqual(_translation.GetFormattedLicenseInvalidGpoHideLicenseTab(_editionWithVersionNumber), result.Message);
        }
예제 #3
0
        public void WhenOnTerminalServer_ShowsMoreInfoInteraction()
        {
            var terminalServerCondition = BuildTerminalServerCondition();

            _terminalServerDetection.IsTerminalServer().Returns(true);

            terminalServerCondition.Check();

            _interactionInvoker.Received().Invoke(Arg.Any <MessageInteraction>());
            var interaction = (MessageInteraction)_interactionInvoker.ReceivedCalls().First().GetArguments()[0];

            Assert.AreEqual("Program\\UsePDFCreatorTerminalServer", interaction.Text);
            Assert.AreEqual(MessageOptions.MoreInfoCancel, interaction.Buttons);
        }