Example #1
0
        /// <summary>
        /// Merges the specified package run into the current one.
        /// </summary>
        /// <param name="other">The other package run to merge.</param>
        public void MergeWith(TestPackageRun other)
        {
            if (other == null)
            {
                throw new ArgumentNullException("other");
            }

            if ((StartTime == DateTime.MinValue) || (StartTime == DateTime.MaxValue) || (other.StartTime < StartTime))
            {
                StartTime = other.StartTime;
            }

            if ((EndTime == DateTime.MinValue) || (EndTime == DateTime.MaxValue) || (other.EndTime > EndTime))
            {
                EndTime = other.EndTime;
            }

            if (RootTestStepRun == null)
            {
                RootTestStepRun = other.RootTestStepRun;
            }
            else
            {
                foreach (var child in other.RootTestStepRun.Children)
                {
                    RootTestStepRun.Children.Add(child);
                }
            }

            Statistics.MergeWith(other.Statistics);
        }