Ejemplo n.º 1
0
            private ITest TryGetTypeTest(ITypeInfo type, ITest assemblyTest)
            {
                ITest typeTest;

                if (!_typeTests.TryGetValue(type, out typeTest))
                {
                    try
                    {
                        foreach (var attribute in type.GetAttributes(null, false))
                        {
                            if (attribute is ConcordionTestAttribute)
                            {
                                typeTest = CreateTypeTest(new ConcordionTypeInfoAdapter(type));
                                break;
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        this._testModel.AddAnnotation(new Annotation(AnnotationType.Error, type, "An exception was thrown while exploring an Concordion test type.", e));
                    }

                    if (typeTest != null)
                    {
                        assemblyTest.AddChild(typeTest);
                        _typeTests.Add(type, typeTest);
                    }
                }

                return(typeTest);
            }
Ejemplo n.º 2
0
            private ITest GetAssemblyTest(IAssemblyInfo assembly, ITest frameworkTest, bool populateRecursively)
            {
                ITest assemblyTest;

                if (!_assemblyTests.TryGetValue(assembly, out assemblyTest))
                {
                    assemblyTest = CreateAssemblyTest(assembly);
                    frameworkTest.AddChild(assemblyTest);

                    _assemblyTests.Add(assembly, assemblyTest);
                }

                GetInputOutputDirectories(assembly);

                if (populateRecursively)
                {
                    foreach (var type in assembly.GetExportedTypes())
                    {
                        TryGetTypeTest(type, assemblyTest);
                    }
                }

                return(assemblyTest);
            }