private void Calculate()
        {
            DataModelValidatorResult validationResult = GetValidationResult();

            if (validationResult != DataModelValidatorResult.ValidResult)
            {
                LogValidationResultMessages(validationResult);
                return;
            }

            try
            {
                IBalancedFieldLengthCalculationModuleFactory factory           = BalancedFieldLengthCalculationModuleFactory.Instance;
                IBalancedFieldLengthCalculationModule        calculationModule = factory.CreateModule();
                BalancedFieldLengthOutput output = calculationModule.Calculate(calculation);

                OutputViewModel = new OutputViewModel(output);
                MessageWindowViewModel.AddMessage(new MessageContext(MessageType.Info, Resources.MainViewModel_Calculate_Calculation_completed));
            }
            catch (Exception e) when(e is CreateKernelDataException || e is KernelCalculationException)
            {
                MessageWindowViewModel.AddMessage(new MessageContext(MessageType.Error, e.Message));
                MessageWindowViewModel.AddMessage(new MessageContext(MessageType.Error, Resources.MainViewModel_Calculate_Calculation_failed));
            }
        }
        public void CreateModule_Always_ReturnsKernel()
        {
            // Setup
            IBalancedFieldLengthCalculationModuleFactory factory = BalancedFieldLengthCalculationModuleFactory.Instance;

            // Call
            IBalancedFieldLengthCalculationModule calculationModule = factory.CreateModule();

            // Assert
            Assert.That(calculationModule, Is.TypeOf <BalancedFieldLengthCalculationModule>());
        }