Exemple #1
0
        public UnitTest CreateUnitTest(WorkspaceObject entry)
        {
            UnitTest test = null;

            if (entry is SolutionFolder)
            {
                test = SolutionFolderTestGroup.CreateTest((SolutionFolder)entry);
            }
            if (entry is Solution)
            {
                test = SolutionFolderTestGroup.CreateTest(((Solution)entry).RootFolder);
            }
            if (entry is Workspace)
            {
                test = WorkspaceTestGroup.CreateTest((Workspace)entry);
            }
            if (entry is DotNetProject)
            {
                test = NUnitProjectTestSuite.CreateTest((DotNetProject)entry);
            }
            if (entry is NUnitAssemblyGroupProject)
            {
                test = ((NUnitAssemblyGroupProject)entry).RootTest;
            }

            UnitTestGroup grp = test as UnitTestGroup;

            if (grp != null && !grp.HasTests)
            {
                test.Dispose();
                return(null);
            }

            return(test);
        }