/// <summary>
        ///     Initializes a new instance of the <see cref="DatabaseHealth" /> class.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public DatabaseHealth(IPluginSettings settings)
        {
            InitializeComponent( );

            var viewModel = new DatabaseHealthViewModel(settings);

            DataContext = viewModel;
        }
        /// <summary>
        ///     Receives the message.
        /// </summary>
        /// <param name="argument">The argument.</param>
        /// <returns></returns>
        public override string Invoke(string argument)
        {
            var strings = argument?.Split(':');

            if (strings?.Length > 0)
            {
                if (strings [0] == "run")
                {
                    DatabaseHealthViewModel model = new DatabaseHealthViewModel(Settings);

                    if (strings.Length > 1)
                    {
                        int maxResults;

                        if (int.TryParse(strings [1], out maxResults))
                        {
                            model.MaxResults = maxResults;
                        }
                        else
                        {
                            model.MaxResults = null;
                        }
                    }
                    else
                    {
                        model.MaxResults = null;
                    }

                    DateTime start = DateTime.UtcNow;
                    model.OnRunTests(true);
                    DateTime end = DateTime.UtcNow;

                    return(model.GenerateJUnitReport(start, end));
                }
            }

            return(null);
        }