Beispiel #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);
        }
        public UpdatedContentPathsAndDisposition(IAttachmentPathResolver attachmentPathResolver, AttachmentContentDisposition attachmentContentDisposition, TestPackageRun testPackageRun)
        {
            this.attachmentPathResolver = attachmentPathResolver;
            this.attachmentContentDisposition = attachmentContentDisposition;
            this.testPackageRun = testPackageRun;

            UpdateContentPathsAndDispositions();
        }
Beispiel #3
0
        public void GetAndSetPackageRun()
        {
            Report report = new Report();

            Assert.IsNull(report.TestPackageRun);

            TestPackageRun value = new TestPackageRun();
            report.TestPackageRun = value;
            Assert.AreSame(value, report.TestPackageRun);
        }
Beispiel #4
0
        public static void AreEqual(TestPackageRun expected, TestPackageRun actual)
        {
            if (expected == null)
            {
                Assert.IsNull(actual);
                return;
            }

            Assert.AreEqual(expected.StartTime, actual.StartTime);
            Assert.AreEqual(expected.EndTime, actual.EndTime);
            AreEqual(expected.Statistics, actual.Statistics);

            Assert.Over.Pairs(expected.AllTestStepRuns, actual.AllTestStepRuns, AreEqual);
        }
        private TestPackageRun MergeTestPackageRun()
        {
            var merged = new TestPackageRun();

            foreach (Report report in reports)
                merged.MergeWith(report.TestPackageRun);

            return merged;
        }
        /// <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);
        }
 public void TestStart()
 {
     testPackageRun = new TestPackageRun();
 }