Пример #1
0
        public void IfToolsVersionIsNotSpecifiedUseHighestOne()
        {
            SetupMsBuildVersions();
            SetupRunProgramTask();

            _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object);
            _task.ExecuteVoid(Context.Object);
        }
Пример #2
0
        public void ToolsVersionWasNotFoundButThereIsNewerOne()
        {
            SetupMsBuildVersions(include40: false);
            SetupRunProgramTask();

            _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object);
            _task.SetToolsVersion(new Version("4.0"));
            _task.ExecuteVoid(Context.Object);
        }
Пример #3
0
        public void ExactToolsVersionWasFound()
        {
            SetupMsBuildVersions();
            SetupRunProgramTask();

            _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object);
            _task.SetToolsVersion(new Version("4.0"));
            _task.ExecuteVoid(Context.Object);
        }
Пример #4
0
        public void ToolsVersionWasNotFoundAndThereIsNoNewerOne()
        {
            SetupMsBuildVersions(include40: false, include120: false);

            _task = new CompileSolutionTask("x.sln", "Release", _flubuEnviroment.Object);
            _task.SetToolsVersion(new Version("4.0"));
            TaskExecutionException ex = Assert.Throws <TaskExecutionException>(() => _task.ExecuteVoid(Context.Object));

            Assert.Equal("Requested MSBuild tools version 4.0 not found and there are no higher versions", ex.Message);
        }