GetTestSuiteInfo() public static méthode

public static GetTestSuiteInfo ( Type testerType, IEnumerable testedTypes ) : TestSuiteInfo
testerType System.Type
testedTypes IEnumerable
Résultat NPerf.Core.Info.TestSuiteInfo
Exemple #1
0
        public void AddAssemblies(params Assembly[] assemblies)
        {
            var newAssemblies = (from assembly in assemblies
                                 where !loadedAssemblies.Contains(assembly)
                                 select assembly).ToArray();

            var allAssemblies = loadedAssemblies.Union(newAssemblies).Distinct().ToArray();

            var newTestSuites = (from assembly in allAssemblies
                                 from tester in assembly.TypesWith <PerfTesterAttribute>()
                                 select
                                 TestSuiteManager.GetTestSuiteInfo(tester, allAssemblies
                                                                   .SelectMany(t => t.Types())
                                                                   .Where(
                                                                       testedType =>
                                                                       IsTestableType(tester,
                                                                                      testedType)),
                                                                   this.testSuites.ToArray()));


            this.testSuites.AddRange(newTestSuites.Where(x => !testSuites.Contains(x)).ToArray());

            loadedAssemblies.AddRange(newAssemblies);
            this.tests = this.testSuites.SelectMany(suite => suite.Tests)
                         .ToDictionary(test => test.TestId, test => test);
        }
Exemple #2
0
        public PerfLab(Assembly fixtureLib, params Assembly[] testSubjects)
        {
            this.SystemInfo = SystemInfo.Instance;

            this.testSuites = (from tester in fixtureLib.TypesWith <PerfTesterAttribute>()
                               select TestSuiteManager.GetTestSuiteInfo(tester, testSubjects.Distinct()
                                                                        .SelectMany(t => t.Types())
                                                                        .Where(
                                                                            testedType =>
                                                                            IsTestableType(tester,
                                                                                           testedType))))
                              .ToList();
            this.tests = this.testSuites.SelectMany(suite => suite.Tests)
                         .ToDictionary(test => test.TestId, test => test);

            loadedAssemblies.AddRange(testSubjects.Union(new[] { fixtureLib })
                                      .Distinct());
        }
Exemple #3
0
        public PerfLab(params Assembly[] perfTestAssemblies)
        {
            this.SystemInfo = SystemInfo.Instance;

            this.testSuites = (from assembly in perfTestAssemblies.Distinct()
                               from tester in assembly.TypesWith <PerfTesterAttribute>()
                               select
                               TestSuiteManager.GetTestSuiteInfo(tester,
                                                                 perfTestAssemblies.SelectMany(t => t.Types())
                                                                 .Where(
                                                                     testedType =>
                                                                     IsTestableType(tester,
                                                                                    testedType))))
                              .ToList();

            this.tests = this.testSuites.SelectMany(suite => suite.Tests)
                         .ToDictionary(test => test.TestId, test => test);

            loadedAssemblies.AddRange(perfTestAssemblies.Distinct());
        }