Exemplo n.º 1
0
        /// <summary>
        ///   Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns> A <see cref="System.String" /> that represents this instance. </returns>
        public override string ToString()
        {
            var failed = Evaluations.OfType <FailedEvaluation>()
                         .Select(e => "    " + e.ToString())
                         .Where(msg => !string.IsNullOrWhiteSpace(msg));

            var passed = Evaluations.OfType <SuccessfulEvaluation>()
                         .Select(e => "    " + e.ToString())
                         .Where(msg => !string.IsNullOrWhiteSpace(msg));

            return
                ($"{Failures.Count()} failed (out of {Evaluations.Count()} evaluations)\n  Failed:\n{string.Join(Environment.NewLine, failed)}\n  Passed:\n{string.Join(Environment.NewLine, passed)}");
        }