public FileExplorer(MSpecUnitTestProvider provider,
                            ElementFactories factories,
                            IFile file,
                            UnitTestElementLocationConsumer consumer,
                            CheckForInterrupt interrupted)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file");
            }

            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            _consumer    = consumer;
            _file        = file;
            _interrupted = interrupted;

            var project = file.GetSourceFile().ToProjectFile().GetProject();

#if !RESHARPER_8
            _assemblyPath = UnitTestManager.GetOutputAssemblyPath(project).FullPath;
#else
            _assemblyPath = project.GetOutputFilePath().FullPath;
#endif

            _elementHandlers = new List <IElementHandler>
            {
                new ContextElementHandler(factories),
                new ContextSpecificationElementHandler(factories),
                new BehaviorElementHandler(factories)
            };
        }
Exemplo n.º 2
0
        public FileExplorer(IUnitTestProvider provider,
                            UnitTestElementLocationConsumer consumer,
                            IFile file,
                            CheckForInterrupt interrupted)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file");
            }

            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            _consumer    = consumer;
            _file        = file;
            _interrupted = interrupted;

            IProject project      = file.ProjectFile.GetProject();
            string   assemblyPath = UnitTestManager.GetOutputAssemblyPath(project).FullPath;

            var cache          = new ContextCache();
            var contextFactory = new ContextFactory(provider, project, assemblyPath, cache);
            var contextSpecificationFactory  = new ContextSpecificationFactory(provider, project, cache);
            var behaviorFactory              = new BehaviorFactory(provider, project, cache);
            var behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, project);

            _elementHandlers = new List <IElementHandler>
            {
                new ContextElementHandler(contextFactory),
                new ContextSpecificationElementHandler(contextSpecificationFactory),
                new BehaviorElementHandler(behaviorFactory, behaviorSpecificationFactory)
            };
        }
Exemplo n.º 3
0
        public FileExplorer(MSpecUnitTestProvider provider,
#if RESHARPER_61
                            IUnitTestElementManager manager,
                            PsiModuleManager psiModuleManager,
                            CacheManager cacheManager,
#endif
                            UnitTestElementLocationConsumer consumer,
                            IFile file,
                            CheckForInterrupt interrupted)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file");
            }

            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            _consumer    = consumer;
            _file        = file;
            _interrupted = interrupted;

#if RESHARPER_6
            IProject project = file.GetSourceFile().ToProjectFile().GetProject();
#else
            IProject project = file.ProjectFile.GetProject();
#endif
            var    projectEnvoy = new ProjectModelElementEnvoy(project);
            string assemblyPath = UnitTestManager.GetOutputAssemblyPath(project).FullPath;

            var cache = new ContextCache();


#if RESHARPER_61
            var contextFactory = new ContextFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, assemblyPath, cache);
            var contextSpecificationFactory  = new ContextSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
            var behaviorFactory              = new BehaviorFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
            var behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy);
#else
            var contextFactory = new ContextFactory(provider, project, projectEnvoy, assemblyPath, cache);
            var contextSpecificationFactory  = new ContextSpecificationFactory(provider, project, projectEnvoy, cache);
            var behaviorFactory              = new BehaviorFactory(provider, project, projectEnvoy, cache);
            var behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, project, projectEnvoy);
#endif

            _elementHandlers = new List <IElementHandler>
            {
                new ContextElementHandler(contextFactory),
                new ContextSpecificationElementHandler(contextSpecificationFactory),
                new BehaviorElementHandler(behaviorFactory, behaviorSpecificationFactory)
            };
        }
Exemplo n.º 4
0
            public MyFileExplorer(IUnitTestProvider provider, UnitTestElementLocationConsumer consumer, IFile file, CheckForInterrupt interrupted)
            {
                if (file == null)
                {
                    throw new ArgumentNullException("file");
                }
                if (provider == null)
                {
                    throw new ArgumentNullException("provider");
                }

                myConsumer     = consumer;
                myProvider     = provider;
                myFile         = file;
                myInterrupted  = interrupted;
                myProject      = myFile.ProjectFile.GetProject();
                myAssemblyPath = UnitTestManager.GetOutputAssemblyPath(myProject).FullPath;
            }
Exemplo n.º 5
0
 public static string GetDllPath(this IProject silverlightProject)
 {
     return(UnitTestManager.GetOutputAssemblyPath(silverlightProject).FullPath);
 }