/// <summary>
        /// Initializes the view-model.
        /// </summary>
        /// <param name="commandDefinition">
        /// The command definition.
        /// </param>
        /// <param name="detailsViewModel">
        /// The details view-model.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// The <paramref name="commandDefinition"/> parameter is null.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// The <paramref name="detailsViewModel"/> parameter is null.
        /// </exception>
        public void Initialize(ExecuteServiceCommandDefinition commandDefinition, IDetailsViewModel detailsViewModel)
        {
            if (commandDefinition == null)
                throw new ArgumentNullException("commandDefinition");

            if (detailsViewModel == null)
                throw new ArgumentNullException("detailsViewModel");

            _commandDefinition = commandDefinition;
            _detailsViewModel = detailsViewModel;
            _canExecuteRule = new HasAccessToExecuteCommandValidator(commandDefinition.SecurityConfigurations.ToArray());

            var serviceManager = DynamicTypeManager.GetIntegrationServiceCallsManager(detailsViewModel.ProcessName);

            if (serviceManager.ContainsService(_commandDefinition.ServiceGuid))
                _callDefinition = serviceManager.GetCallDefinition(_commandDefinition.ServiceGuid);

            CreateDetailsPropertyChangedListener();
        }
 public void Initialize_WhenDetailsViewModelIsNull_ThrowsArgumentNullException()
 {
     var commandViewModel = new ExecuteServiceCommandViewModel();
     var commandDefinition = new ExecuteServiceCommandDefinition(string.Empty, string.Empty, Guid.NewGuid(), new List<HasAccessToExecuteCommandValidator.ProcessCommandSecurityConfiguration>(), Guid.NewGuid(), null);
     commandViewModel.Initialize(commandDefinition, null);
 }