void CreateProjectItems() { project = new TestableDTEProject(); msbuildProject = project.TestableProject; projectItems = project.ProjectItems; fakeFileService = project.FakeFileService; }
public TestableDTEProject(TestableProject project) : this( project, new FakePackageManagementProjectService(), new FakeFileService(project)) { }
void CreateCodeModel() { helper = new ProjectContentHelper(); msbuildProject = ProjectHelper.CreateTestProject(); helper.SetProjectForProjectContent(msbuildProject); codeModel = new CodeModel(helper.ProjectContent); }
void CreateReferences() { project = new TestableDTEProject(); msbuildProject = project.TestableProject; fakeProjectService = project.FakeProjectService; references = project.Object.References; }
void CreateProperties() { project = new TestableDTEProject(); msbuildProject = project.TestableProject; var factory = new ProjectPropertyFactory(project); properties = new ICSharpCode.PackageManagement.EnvDTE.Properties(factory); }
void CreateProperties() { project = new TestableDTEProject(); msbuildProject = project.TestableProject; var factory = new ProjectPropertyFactory(project); properties = new Properties(factory); }
void CreateProjectItems(string fileName = @"d:\projects\MyProject\MyProject.csproj") { project = new TestableDTEProject(); msbuildProject = project.TestableProject; msbuildProject.FileName = new FileName(fileName); projectItems = (ProjectItems)project.ProjectItems; fakeFileService = project.FakeFileService; }
void CreateReference(string name) { project = new TestableDTEProject(); msbuildProject = project.TestableProject; referenceProjectItem = msbuildProject.AddReference(name); fakeProjectService = project.FakeProjectService; CreateReference(project, referenceProjectItem); }
void CreateProject() { fakeMSBuildProject = ProjectHelper.CreateTestProject(); fakeMSBuildProject.SetProperty("TargetFrameworkIdentifier", null); fakeMSBuildProject.SetProperty("TargetFrameworkVersion", "v4.0"); fakeMSBuildProject.SetProperty("TargetFrameworkProfile", null); CreateProject(fakeMSBuildProject); }
void CreateProjectItemProperties() { project = new TestableDTEProject(); msbuildProject = project.TestableProject; msbuildFileProjectItem = new SD.FileProjectItem(msbuildProject, SD.ItemType.Compile); projectItem = new ProjectItem(project, msbuildFileProjectItem); properties = projectItem.Properties; }
void CreateCmdlet() { cmdlet = new TestableGetProjectCmdlet(); fakeTerminatingError = cmdlet.FakeCmdletTerminatingError; fakeCommandRuntime = cmdlet.FakeCommandRuntime; fakeConsoleHost = cmdlet.FakePackageManagementConsoleHost; fakeSolution = cmdlet.FakeSolution; defaultProject = base.AddDefaultProjectToConsoleHost(); }
public SD.FileProjectItem AddFileToFirstProjectInSolution(string include) { TestableProject project = FakeProjectService .AllProjects .Select(p => p as TestableProject) .First(); return(project.AddFile(include)); }
public SD.FileProjectItem AddFileToSecondProjectInSolution(string include) { TestableProject project = FakeProjectService .FakeOpenProjects .Select(p => p as TestableProject) .Skip(1) .First(); return project.AddFile(include); }
void CreateInstaller() { project = ProjectHelper.CreateTestProject(); packageReferences = new List<PackageReference>(); fakeActionRunner = new FakePackageActionRunner(); fakeProjectFactory = new FakePackageManagementProjectFactory(); fakeRepositoryCache = new FakePackageRepositoryFactory(); installer = new PackageReferenceInstaller(fakeRepositoryCache, fakeActionRunner, fakeProjectFactory); }
void CreateReference(string name) { project = new TestableDTEProject(); msbuildProject = project.TestableProject; referenceProjectItem = msbuildProject.AddReference(name); fakeProjectService = project.FakeProjectService; CreateReference(project, referenceProjectItem); IWorkbench workbench = MockRepository.GenerateStub<IWorkbench>(); ICSharpCode.SharpDevelop.SD.Services.AddService(typeof(IWorkbench), workbench); }
public TestableDTEProject( TestableProject project, FakePackageManagementProjectService projectService, FakeFileService fileService) : base(project, projectService, fileService) { this.TestableProject = project; this.FakeProjectService = projectService; this.FakeFileService = fileService; }
void CreateProjectWithOneFileInProjectFolder( string include, string projectFileName = @"c:\projects\MyProject\MyProject.csproj") { project = new TestableDTEProject(); msbuildProject = project.TestableProject; fakeFileService = project.FakeFileService; msbuildProject.FileName = new FileName(projectFileName); msbuildProject.AddFile(include); }
TestableProject CreateProjectReference() { project = new TestableDTEProject(); msbuildProject = project.TestableProject; TestableProject referencedProject = ProjectHelper.CreateTestProject(); ProjectReferenceProjectItem referenceProjectItem = msbuildProject.AddProjectReference(referencedProject); fakeProjectService = project.FakeProjectService; CreateReference(project, referenceProjectItem); return referencedProject; }
void CreateProjectWithOneFile(string fileName) { project = new TestableDTEProject(); msbuildProject = project.TestableProject; fakeFileService = project.FakeFileService; fileProjectItem = new FileProjectItem(msbuildProject, ItemType.Compile) { FileName = fileName }; }
public static TestableProject CreateTestProject( ISolution parentSolution, string name, string fileName = null) { var createInfo = new ProjectCreateInformation(parentSolution, new FileName(fileName ?? (@"d:\projects\Test\TestProject\" + name + ".csproj"))); var project = new TestableProject(createInfo); ((ICollection<IProject>)parentSolution.Projects).Add(project); return project; }
void CreateProjectItemProperties() { project = new TestableDTEProject(); msbuildProject = project.TestableProject; msbuildFileProjectItem = new SD.FileProjectItem(msbuildProject, SD.ItemType.Compile); projectItem = new ProjectItem(project, msbuildFileProjectItem); properties = (ICSharpCode.PackageManagement.EnvDTE.Properties)projectItem.Properties; IWorkbench workbench = MockRepository.GenerateStub<IWorkbench>(); ICSharpCode.SharpDevelop.SD.Services.AddService(typeof(IWorkbench), workbench); }
void CreateProject() { msbuildProject = ProjectHelper.CreateTestProject(); helper = new ProjectContentHelper(); fakeProjectService = MockRepository.GenerateStub<IPackageManagementProjectService>(); fakeProjectService.Stub(service => service.GetProjectContent(msbuildProject)).Return(helper.ProjectContent); fakeFileService = MockRepository.GenerateStub<IPackageManagementFileService>(); project = new Project(msbuildProject, fakeProjectService, fakeFileService); }
void CreateProject(string fileName = @"d:\projects\MyProject\MyProject.csproj", string language = "C#") { msbuildProject = ProjectHelper.CreateTestProject(); msbuildProject.FileName = new FileName(fileName); //helper = new ProjectContentHelper(); fakeProjectService = MockRepository.GenerateStub<IPackageManagementProjectService>(); //fakeProjectService.Stub(service => service.GetProjectContent(msbuildProject)).Return(helper.ProjectContent); fakeFileService = MockRepository.GenerateStub<IPackageManagementFileService>(); project = new Project(msbuildProject, fakeProjectService, fakeFileService); }
public static FileProjectItem GetFileFromInclude(TestableProject project, string include) { foreach (ProjectItem projectItem in project.Items) { FileProjectItem fileItem = projectItem as FileProjectItem; if (fileItem != null) { if (fileItem.Include == include) { return fileItem; } } } return null; }
public static TestableProject CreateTestProject( ISolution parentSolution, string name, string fileName = null) { var createInfo = new ProjectCreateInformation(parentSolution, new FileName(fileName ?? (@"d:\projects\Test\TestProject\" + name + ".csproj"))); var project = new TestableProject(createInfo); ((ICollection <IProject>)parentSolution.Projects).Add(project); ((ICollection <ISolutionItem>)parentSolution.Items).Add(project); return(project); }
TestableProject CreateProjectReference(string parentProjectFileName, string referencedProjectFileName) { project = new TestableDTEProject(); msbuildProject = project.TestableProject; msbuildProject.FileName = new FileName(parentProjectFileName); TestableProject referencedProject = ProjectHelper.CreateTestProject(); referencedProject.FileName = new FileName(referencedProjectFileName); ((ICollection<IProject>)msbuildProject.ParentSolution.Projects).Add(referencedProject); IWorkbench workbench = MockRepository.GenerateStub<IWorkbench>(); ICSharpCode.SharpDevelop.SD.Services.AddService(typeof(IWorkbench), workbench); ProjectReferenceProjectItem referenceProjectItem = msbuildProject.AddProjectReference(referencedProject); fakeProjectService = project.FakeProjectService; CreateReference(project, referenceProjectItem); return referencedProject; }
public static FileProjectItem GetFileFromInclude(TestableProject project, string include) { foreach (ProjectItem projectItem in project.Items) { FileProjectItem fileItem = projectItem as FileProjectItem; if (fileItem != null) { if (fileItem.Include == include) { return(fileItem); } } } return(null); }
void CreateProject() { fakePackageManagerFactory = new FakePackageManagerFactory(); fakePackageManager = fakePackageManagerFactory.FakePackageManager; fakeProjectManager = fakePackageManager.FakeProjectManager; fakeSourceRepository = new FakePackageRepository(); fakeMSBuildProject = ProjectHelper.CreateTestProject(); fakePackageManagementEvents = new FakePackageManagementEvents(); project = new PackageManagementProject( fakeSourceRepository, fakeMSBuildProject, fakePackageManagementEvents, fakePackageManagerFactory); }
public static TestableProject CreateTestProject(string name) { Solution solution = new Solution(new MockProjectChangeWatcher()); solution.FileName = @"d:\projects\Test\TestSolution.sln"; ProjectCreateInformation createInfo = new ProjectCreateInformation(); createInfo.Solution = solution; createInfo.ProjectName = name; createInfo.SolutionPath = @"d:\projects\Test"; createInfo.ProjectBasePath = @"d:\projects\Test\TestProject"; createInfo.OutputProjectFileName = @"d:\projects\Test\TestProject\TestProject.csproj"; var project = new TestableProject(createInfo); project.Parent = solution; return project; }
void CreateSolution(PackageManagementOptions options) { testProject = ProjectHelper.CreateTestProject(); fakeRegisteredPackageRepositories = new FakeRegisteredPackageRepositories(); fakeProjectFactory = new FakePackageManagementProjectFactory(); fakeProjectService = new FakePackageManagementProjectService(); var packageManagementEvents = new FakePackageManagementEvents(); fakeProjectService.CurrentProject = testProject; solution = new PackageManagementSolution( fakeRegisteredPackageRepositories, packageManagementEvents, fakeProjectService, fakeProjectFactory); }
void CreatePackageManagementService(PackageManagementOptions options) { testProject = ProjectHelper.CreateTestProject(); fakePackageRepositoryFactory = new FakePackageRepositoryFactory(); fakePackageManagerFactory = new FakePackageManagerFactory(); fakeProjectService = new FakePackageManagementProjectService(); fakeOutputMessagesView = new FakePackageManagementOutputMessagesView(); fakeProjectService.CurrentProject = testProject; packageManagementService = new PackageManagementService(options, fakePackageRepositoryFactory, fakePackageManagerFactory, fakeProjectService, fakeOutputMessagesView); installPackageHelper = new InstallPackageHelper(packageManagementService); }
public static TestableProject CreateTestProject( Solution parentSolution, string name, string fileName = @"d:\projects\Test\TestProject\TestProject.csproj") { ProjectCreateInformation createInfo = new ProjectCreateInformation(); createInfo.Solution = parentSolution; createInfo.ProjectName = name; createInfo.SolutionPath = @"d:\projects\Test"; createInfo.ProjectBasePath = @"d:\projects\Test\TestProject"; createInfo.OutputProjectFileName = fileName; var project = new TestableProject(createInfo); project.Parent = parentSolution; parentSolution.AddFolder(project); return project; }
protected void CreateCodeModel() { msbuildProject = ProjectHelper.CreateTestProject(); projectService = MockRepository.GenerateStub<IPackageManagementProjectService>(); fileService = MockRepository.GenerateStub<IPackageManagementFileService>(); dteProject = new Project(msbuildProject, projectService, fileService); codeModelContext.DteProject = dteProject; codeModel = new CodeModel(codeModelContext, dteProject); msbuildProject.SetAssemblyModel(assemblyModel); project.Stub(p => p.AssemblyModel).Return(assemblyModel); fileService .Stub(fs => fs.GetCompilationUnit(msbuildProject)) .WhenCalled(compilation => compilation.ReturnValue = CreateCompilation()); }
public static TestableProject CreateTestProject() { Solution solution = new Solution(); solution.FileName = @"d:\projects\Test\TestSolution.sln"; ProjectCreateInformation createInfo = new ProjectCreateInformation(); createInfo.Solution = solution; createInfo.ProjectName = "TestProject"; createInfo.SolutionPath = @"d:\projects\Test"; createInfo.ProjectBasePath = @"d:\projects\Test\TestProject"; createInfo.OutputProjectFileName = @"d:\projects\Test\TestProject\TestProject.csproj"; var project = new TestableProject(createInfo); project.Parent = solution; return(project); }
public static TestableProject CreateTestProject( Solution parentSolution, string name, string fileName = @"d:\projects\Test\TestProject\TestProject.csproj") { ProjectCreateInformation createInfo = new ProjectCreateInformation(); createInfo.Solution = parentSolution; createInfo.ProjectName = name; createInfo.SolutionPath = @"d:\projects\Test"; createInfo.ProjectBasePath = @"d:\projects\Test\TestProject"; createInfo.OutputProjectFileName = fileName; var project = new TestableProject(createInfo); project.Parent = parentSolution; parentSolution.AddFolder(project); return(project); }
public static TestableProject CreateTestProject(string name) { Solution solution = new Solution(new MockProjectChangeWatcher()); solution.FileName = @"d:\projects\Test\TestSolution.sln"; ProjectCreateInformation createInfo = new ProjectCreateInformation(); createInfo.Solution = solution; createInfo.ProjectName = name; createInfo.SolutionPath = @"d:\projects\Test"; createInfo.ProjectBasePath = @"d:\projects\Test\TestProject"; createInfo.OutputProjectFileName = @"d:\projects\Test\TestProject\TestProject.csproj"; var project = new TestableProject(createInfo); project.Parent = solution; solution.AddFolder(project); return(project); }
void CreateSolution(PackageManagementOptions options) { testProject = ProjectHelper.CreateTestProject(); fakeRegisteredPackageRepositories = new FakeRegisteredPackageRepositories(); fakeProjectFactory = new FakePackageManagementProjectFactory(); fakeProjectService = new FakePackageManagementProjectService(); fakeProjectService.CurrentProject = testProject; fakeProjectService.OpenSolution = testProject.ParentSolution; fakeSolutionPackageRepositoryFactory = new FakeSolutionPackageRepositoryFactory(); fakeSolutionPackageRepository = fakeSolutionPackageRepositoryFactory.FakeSolutionPackageRepository; solution = new PackageManagementSolution( fakeRegisteredPackageRepositories, fakeProjectService, fakeProjectFactory, fakeSolutionPackageRepositoryFactory); }
public void AddProjectToSolution(string projectName) { TestableProject project = ProjectHelper.CreateTestProject(projectName); FakeProjectService.AddFakeProject(project); }
public TestableProject AddProjectToSolutionWithFileName(string projectName, string fileName) { TestableProject project = ProjectHelper.CreateTestProject(MSBuildSolution, projectName, fileName); FakeProjectService.AddFakeProject(project); return project; }
public static void AddWebSiteProjectType(TestableProject project) { AddProjectType(project, ProjectTypeGuids.WebSite); }