/// <summary>
        /// Initializes a new instance of the TestClassData type.
        /// </summary>
        /// <param name="testClass">The test class metadata.</param>
        /// <param name="parent">The parent test assembly data object.</param>
        public TestClassData(ITestClass testClass, TestAssemblyData parent)
        {
            _methods = new ObservableCollection <TestMethodData>();
            _parent  = parent;

            Name      = testClass.Name;
            Namespace = testClass.Namespace;
        }
Beispiel #2
0
    /// <summary>
    /// Initializes a new instance of the TestClassData type.
    /// </summary>
    /// <param name="testClass">The test class metadata.</param>
    /// <param name="parent">The parent test assembly data object.</param>
    public TestClassData(ITestClass testClass, TestAssemblyData parent)
    {
      _methods = new ObservableCollection<TestMethodData>();
      _parent = parent;

      Name = testClass.Name;
      Namespace = testClass.Namespace;
    }
        /// <summary>
        /// Gets or creates the data model object for an assembly.
        /// </summary>
        /// <param name="assembly">The test assembly.</param>
        /// <returns>Returns the data object.</returns>
        public TestAssemblyData GetAssemblyModel(IAssembly assembly)
        {
            TestAssemblyData data;

            if (!_assemblyData.TryGetValue(assembly, out data))
            {
                data = new TestAssemblyData(assembly);
                _assemblyData.Add(assembly, data);

                // Make sure in parent collection
                _d.TestAssemblies.Add(data);
            }

            return(data);
        }
        /// <summary>
        /// Gets or creates the data model object for a test class.
        /// </summary>
        /// <param name="testClass">The test class.</param>
        /// <returns>Returns the data object.</returns>
        public TestClassData GetClassModel(ITestClass testClass)
        {
            TestClassData data;

            if (!_classData.TryGetValue(testClass, out data))
            {
                TestAssemblyData tad = GetAssemblyModel(testClass.Assembly);
                data = new TestClassData(testClass, tad);
                _classData.Add(testClass, data);

                // Make sure in parent collection
                tad.TestClasses.Add(data);
            }

            return(data);
        }
Beispiel #5
0
        /// <summary>
        /// Gets or creates the data model object for an assembly.
        /// </summary>
        /// <param name="assembly">The test assembly.</param>
        /// <returns>Returns the data object.</returns>
        public TestAssemblyData GetAssemblyModel(IAssembly assembly)
        {
            TestAssemblyData data;
            if (!_assemblyData.TryGetValue(assembly, out data))
            {
                data = new TestAssemblyData(assembly);
                _assemblyData.Add(assembly, data);

                // Make sure in parent collection
                _d.TestAssemblies.Add(data);
            }

            return data;
        }