Esempio n. 1
0
 /// <summary>
 /// Constructs an MbUnitCpp tests.
 /// </summary>
 /// <param name="testInfoData">Information about the test.</param>
 /// <param name="resolver"></param>
 public MbUnitCppTest(TestInfoData testInfoData, IStringResolver resolver)
     : base(testInfoData.Name, testInfoData.FakeCodeElement)
 {
     this.testInfoData = testInfoData;
     Id         = testInfoData.GetId();
     Kind       = GetKind(testInfoData.Kind);
     IsTestCase = !testInfoData.HasChildren;
     Metadata.AddAll(testInfoData.GetMetadata(resolver));
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a step.
        /// </summary>
        /// <remarks>
        /// <para>
        /// If <paramref name="isPrimary"/> is true, then all metadata from the <paramref name="test"/>
        /// is copied to the step.  Otherwise the new step will have no metadata initially.
        /// </para>
        /// </remarks>
        /// <param name="test">The test to which the step belongs.</param>
        /// <param name="parent">The parent step, or null if creating a root step.</param>
        /// <param name="name">The step name.</param>
        /// <param name="codeElement">The point of definition of the step, or null if unknown.</param>
        /// <param name="isPrimary">True if the test step is primary.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="name"/>
        /// or <paramref name="test"/> is null.</exception>
        public TestStep(Test test, TestStep parent, string name, ICodeElementInfo codeElement, bool isPrimary)
            : base(name, codeElement)
        {
            if (test == null)
            {
                throw new ArgumentNullException("test");
            }
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            this.test      = test;
            this.parent    = parent;
            this.isPrimary = isPrimary;

            isTestCase = test.IsTestCase;

            if (isPrimary)
            {
                Metadata.AddAll(test.Metadata);
            }
        }