public void TestSetSolutionContext() { var project = new Project(); var configuration = new Configuration { SolutionConfiguration = "Debug", SolutionPlatform = "Any CPU" }; project.AvailableConfigurations.Add(configuration); Assert.That(project.ActiveConfiguration, Is.Null); project.SetSolutionContext("Debug", "Any CPU"); Assert.That(project.ActiveConfiguration, Is.EqualTo(configuration)); }
public DesignTimeConfigurationManager() { IsSolutionAvailable = true; AvailableSolutionConfigurations.Add("Debug"); AvailableSolutionPlatforms.Add("Any CPU"); ActiveSolutionConfiguration = "Debug"; ActiveSolutionPlatform = "Any CPU"; ShowStatusText = true; StatusText = "Loading..."; var firstProject = new Project { Name = "Namespace.FirstProject" }; firstProject.ActiveConfiguration = new Configuration { ProjectConfiguration = "Debug", AvailableProjectConfigurations = new[] { "Debug" }, ProjectPlatform = "Any CPU", AvailableProjectPlatforms = new[] { "Any CPU" }, IsDeployable = false, IsBuildable = true, ShouldBuild = true, ShouldDeploy = false }; Projects.Add(firstProject); var secondProject = new Project { Name = "Namespace.SecondProject" }; secondProject.ActiveConfiguration = new Configuration { ProjectConfiguration = "Debug", AvailableProjectConfigurations = new[] { "Debug" }, ProjectPlatform = "x86", AvailableProjectPlatforms = new[] { "x86" }, IsDeployable = true, IsBuildable = true, ShouldBuild = true, ShouldDeploy = true }; Projects.Add(secondProject); }
public MockConfigurationManager() { var projectNames = new[] { "Namespace.FirstProject", "Namespace.SecondProject" }; var platforms = new[] { "Any CPU", "x86" }; var configurations = new[] { "Debug", "Release" }; foreach (string name in projectNames) { var project = new Project { Name = name }; foreach (string platform in platforms) { foreach (string configuration in configurations) { project.AvailableConfigurations.Add(new Configuration { SolutionConfiguration = configuration, SolutionPlatform = platform, ProjectConfiguration = configuration, AvailableProjectConfigurations = configurations, ProjectPlatform = platform, AvailableProjectPlatforms = platforms }); } } Projects.Add(project); } ActiveSolutionConfiguration = "Debug"; ActiveSolutionPlatform = "Any CPU"; }
private static IEnumerable<Configuration> GetConfigurationsForSolutionPlatform( Project project, string platform) { return project.AvailableConfigurations.Where(c => c.SolutionPlatform == platform); }
private static IEnumerable<Configuration> GetConfigurationsForSolutionConfiguration( Project project, string configuration) { return project.AvailableConfigurations.Where(c => c.SolutionConfiguration == configuration); }
private static Configuration GetConfiguration(Project project, string solutionConfiguration, string solutionPlatform) { return project.AvailableConfigurations.First(p => p.SolutionConfiguration == solutionConfiguration && p.SolutionPlatform == solutionPlatform); }