Exemplo n.º 1
0
        internal MethodNode(String name, Verbosity verbosity, IEnumerable <KeyValuePair <IResultKey, ITestMethodResult> > results)
            : base(name, verbosity, results)
        {
            if (verbosity > Verbosity.MethodName || HasFails || HasIgnores || HasBlanks)
            {
                ITestMethodResult result = results.First().Value;

                Int32 index = 1;
                IsIgnored    = result.IsIgnored;
                IgnoreReason = result.IgnoreReason;
                IsEmpty      = result.IsEmpty;
                IsFailed     = result.IsFailed;

                foreach (ITestEntry entry in result.TestEntries)
                {
                    if (entry.EntryType == EntryTypes.Error)
                    {
                        Children.Add(new ErrorLeaf("Error", entry));
                    }
                    else if (entry.EntryType == EntryTypes.Note)
                    {
                        Children.Add(new NoteLeaf("Note", entry));
                    }
                    else if (entry.EntryType == EntryTypes.Injection)
                    {
                        Children.Add(new InjectionLeaf("Parameter Injection", entry));
                    }
                    else
                    {
                        Children.Add(new ResultLeaf($"#{index++}: {entry.Instruction}", entry));
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Appends <paramref name="data"/> to the <see cref="Payload"/> <see cref="MemoryStream"/>.
        /// </summary>
        /// <param name="data">The data object.</param>
        /// <returns>The current <see cref="IMessage"/>.</returns>
        public IMessage Append(ITestMethodResult data)
        {
            Append(data.IgnoreReason ?? String.Empty);
            Append(data.TestEntries.Count);
            data.TestEntries.Foreach(entry => Append(entry));

            return(this);
        }
Exemplo n.º 3
0
        internal Method(String name, ITestMethodResult method)
        {
            Throw.If.String.IsNullOrWhiteSpace(name, nameof(name));
            Throw.If.Object.IsNull(method, nameof(method));

            Name         = name;
            Entries      = new List <Entry>(method.TestEntries.Select(e => new Entry(e)));
            IgnoreReason = method.IgnoreReason;
        }
Exemplo n.º 4
0
        public void Add(IResultKey key, ITestMethodResult results)
        {
            _log.Debug($"{nameof(Add)}({key.Format()}, {results.CountEntries.Format()})");

            _results.AddOrUpdate(key, results, (_, __) => results);
        }
Exemplo n.º 5
0
 public void Create(out ITestMethodResult @object) => @object = new TestMethodResult();