Example #1
0
        public void Constructor_ValueAsProjectAccessor_SetsProjectAccessorProperty()
        {
            var project                           = UnconfiguredProjectFactory.Create();
            var threadingService                  = new Lazy <IProjectThreadingService>(() => IProjectThreadingServiceFactory.Create());
            var projectProperties                 = ProjectPropertiesFactory.Create(project);
            var activeConfiguredProject           = ActiveConfiguredProjectFactory.ImplementValue(() => projectProperties.ConfiguredProject);
            var activeConfiguredProjectProperties = ActiveConfiguredProjectFactory.ImplementValue(() => projectProperties);
            var projectAccessor                   = new Lazy <IProjectAccessor>(() => IProjectAccessorFactory.Create());

            var services = new UnconfiguredProjectCommonServices(project, threadingService, activeConfiguredProject, activeConfiguredProjectProperties, projectAccessor);

            Assert.Same(projectAccessor.Value, services.ProjectAccessor);
        }
        public void Constructor_ValueAsActiveConfiguredProjectProperties_SetsActiveConfiguredProjectPropertiesProperty()
        {
            var project                           = UnconfiguredProjectFactory.Create();
            var projectTree                       = new Lazy <IPhysicalProjectTree>(() => IPhysicalProjectTreeFactory.Create());
            var threadingService                  = new Lazy <IProjectThreadingService>(() => IProjectThreadingServiceFactory.Create());
            var projectProperties                 = ProjectPropertiesFactory.Create(project);
            var activeConfiguredProject           = ActiveConfiguredProjectFactory.ImplementValue(() => projectProperties.ConfiguredProject);
            var activeConfiguredProjectProperties = ActiveConfiguredProjectFactory.ImplementValue(() => projectProperties);
            var projectLockService                = new Lazy <IProjectLockService>(() => IProjectLockServiceFactory.Create());

            var services = new UnconfiguredProjectCommonServices(project, projectTree, threadingService, activeConfiguredProject, activeConfiguredProjectProperties, projectLockService);

            Assert.Same(projectProperties, services.ActiveConfiguredProjectProperties);
        }
        private PhysicalProjectTreeStorage CreateInstance(IProjectTreeService treeService = null, IProjectTreeProvider treeProvider = null, IFileSystem fileSystem = null, IFolderManager folderManager = null, UnconfiguredProject project = null)
        {
            treeService = treeService ?? IProjectTreeServiceFactory.Create(ProjectTreeParser.Parse("Root"));
            treeProvider = treeProvider ?? IProjectTreeProviderFactory.Create();
            fileSystem = fileSystem ?? IFileSystemFactory.Create();
            folderManager = folderManager ?? IFolderManagerFactory.Create();
            project = project ?? UnconfiguredProjectFactory.Create();

            return new PhysicalProjectTreeStorage(new Lazy<IProjectTreeService>(() => treeService),
                                                  new Lazy<IProjectTreeProvider>(() => treeProvider),
                                                  new Lazy<IFileSystem>(() => fileSystem),
                                                  ActiveConfiguredProjectFactory.ImplementValue(() => folderManager),
                                                  project);
        }