public void OnlineActivationCommand_WhenExecuted_CallsLicenseChecker()
        {
            _expectedLicenseKey = "ABCDEF";
            _interactionInvoker.When(x => x.Invoke(Arg.Any <InputInteraction>())).Do(
                x =>
            {
                ((InputInteraction)x[0]).Success   = true;
                ((InputInteraction)x[0]).InputText = _expectedLicenseKey;
            });

            _interactionInvoker.When(x => x.Invoke(Arg.Any <MessageInteraction>())).Do(
                x => {
            });
            var viewModel = BuildViewModel();

            viewModel.OnlineActivationCommand.Execute(null);

            viewModel.LicenseCheckFinishedEvent.WaitOne(_timeout);
            _activationHelper.Received().ActivateWithoutSavingActivation(_expectedLicenseKey);
        }
Esempio n. 2
0
        public void WithActivationValidForLessThanFourDays_RenewsActivation()
        {
            var licenseCondition = BuildCheckLicenseConditions();

            _activationHelper.LicenseStatus.Returns(LicenseStatus.Valid);
            _activationHelper.Activation.ActivatedTill = DateTime.Now.AddDays(3);
            _activationHelper.Activation.Key           = "AAA-BBB-CCC";

            licenseCondition.Check();

            _activationHelper.Received().RenewActivation();
        }