Example #1
0
 protected override void Context()
 {
     base.Context();
     _entity           = new Container();
     _validationResult = A.Fake <ValidationResult>();
     A.CallTo(() => _validationResult.ValidationState).Returns(ValidationState.Invalid);
     _presenter = A.Fake <IValidationMessagesPresenter>();
     A.CallTo(() => _applicationController.Start <IValidationMessagesPresenter>()).Returns(_presenter);
     A.CallTo(() => _entityValidator.Validate(_entity)).Returns(_validationResult);
     A.CallTo(() => _presenter.Display(_validationResult)).Returns(true);
 }
Example #2
0
        protected override void Context()
        {
            _executionContext                 = A.Fake <IOSPSuiteExecutionContext>();
            _sensitivityAnalysisFactory       = A.Fake <ISensitivityAnalysisFactory>();
            _applicationController            = A.Fake <IApplicationController>();
            _sensitivityAnalysisSwapCorrector = A.Fake <ISensitivityAnalysisSimulationSwapCorrector>();
            _sensitivityAnalysisSwapValidator = A.Fake <ISensitivityAnalysisSimulationSwapValidator>();
            _dialogCreator = A.Fake <IDialogCreator>();
            sut            = new SensitivityAnalysisTask(_sensitivityAnalysisFactory, _executionContext, _applicationController, _sensitivityAnalysisSwapCorrector, _sensitivityAnalysisSwapValidator, _dialogCreator);

            _validationMessagesPresenter = A.Fake <IValidationMessagesPresenter>();
            A.CallTo(() => _applicationController.Start <IValidationMessagesPresenter>()).Returns(_validationMessagesPresenter);
        }
Example #3
0
        protected override void Context()
        {
            base.Context();
            _newSimulation = A.Fake <ISimulation>();
            _oldSimulation = A.Fake <ISimulation>();
            _validationMessagesPresenter = A.Fake <IValidationMessagesPresenter>();
            _parameterIdentification     = A.Fake <ParameterIdentification>();

            A.CallTo(() => _applicationController.Start <IValidationMessagesPresenter>()).Returns(_validationMessagesPresenter);
            _validationResult = new ValidationResult(new[] { new ValidationMessage(NotificationType.Warning, "", _parameterIdentification, null) });
            A.CallTo(() => _simulationSwapValidator.ValidateSwap(_parameterIdentification, _oldSimulation, _newSimulation)).Returns(_validationResult);
            A.CallTo(() => _validationMessagesPresenter.Display(_validationResult)).Returns(true);

            _newSimulation.IsLoaded = false;
        }
Example #4
0
        protected override void Context()
        {
            _view = A.Fake <ISensitivityAnalysisParameterSelectionView>();
            _simulationParametersPresenter          = A.Fake <ISimulationParametersPresenter>();
            _sensitivityAnalysisParametersPresenter = A.Fake <ISensitivityAnalysisParametersPresenter>();
            _simulationRepository        = A.Fake <ISimulationRepository>();
            _lazyLoadTask                = A.Fake <ILazyLoadTask>();
            _simulationSelector          = A.Fake <ISimulationSelector>();
            _sensitivityAnalysisTask     = A.Fake <ISensitivityAnalysisTask>();
            _applicationController       = A.Fake <IApplicationController>();
            _validationMessagesPresenter = A.Fake <IValidationMessagesPresenter>();
            A.CallTo(() => _applicationController.Start <IValidationMessagesPresenter>()).Returns(_validationMessagesPresenter);


            sut = new SensitivityAnalysisParameterSelectionPresenter(_view, _simulationParametersPresenter, _sensitivityAnalysisParametersPresenter, _simulationRepository, _lazyLoadTask, _simulationSelector, _sensitivityAnalysisTask, _applicationController);

            _sensitivityAnalysis = new SensitivityAnalysis {
                Simulation = A.Fake <ISimulation>()
            };
            _simulations = new[] { _sensitivityAnalysis.Simulation };
            A.CallTo(() => _simulationRepository.All()).Returns(_simulations);
            A.CallTo(() => _simulationSelector.SimulationCanBeUsedForSensitivityAnalysis(_sensitivityAnalysis.Simulation)).Returns(true);
        }
 public void AttachPresenter(IValidationMessagesPresenter presenter)
 {
 }