Пример #1
0
        public void GetBuildTargetsForExecution_ProjectIsExecutionTarget()
        {
            using (var project = new ProjectWithExecutionDeps("Executing")) {
                var targets = ProjectOperations.GetBuildTargetsForExecution(project, null);

                Assert.AreEqual(project, targets.Single());
            }
        }
Пример #2
0
        public void GetBuildTargetsForExecution_Solution_SingleItemRunConfiguration()
        {
            using (var project = new ProjectWithExecutionDeps("Executing"))
                using (var sln = CreateSimpleSolutionWithItems(project)) {
                    var runConfig = new SingleItemSolutionRunConfiguration(project, null);
                    var targets   = ProjectOperations.GetBuildTargetsForExecution(sln, runConfig);

                    Assert.AreEqual(project, targets.Single());
                }
        }
Пример #3
0
        public void GetBuildTargetsForExecution_Solution_NoStartupItem_NoRunConfigurationPassed()
        {
            using (var project = new ProjectWithExecutionDeps("Executing"))
                using (var sln = CreateSimpleSolutionWithItems(project)) {
                    sln.StartupConfiguration = null;
                    var targets = ProjectOperations.GetBuildTargetsForExecution(sln, null);

                    Assert.IsNull(sln.StartupItem);
                    Assert.AreEqual(sln, targets.Single());
                }
        }
Пример #4
0
        public void GetBuildTargetsForExecution_Solution_MultiItemRunConfiguration()
        {
            using (var executionDep = new ProjectWithExecutionDeps("Dependency"))
                using (var executing = new ProjectWithExecutionDeps("Executing"))
                    using (var sln = CreateSimpleSolutionWithItems(executionDep, executing)) {
                        var runConfig = new MultiItemSolutionRunConfiguration();
                        runConfig.Items.Add(new StartupItem(executing, null));
                        runConfig.Items.Add(new StartupItem(executionDep, null));

                        var targets = ProjectOperations.GetBuildTargetsForExecution(sln, runConfig);

                        Assert.AreEqual(2, targets.Length);
                        Assert.AreEqual(executing, targets [0]);
                        Assert.AreEqual(executionDep, targets [1]);
                    }
        }