Exemplo n.º 1
0
        public void SingleFileRunWithFilterTest()
        {
            var taskItemStub = MockRepository.GenerateStub <ITaskItem>();

            taskItemStub.ItemSpec = Path.Combine(TaskUtility.GetProjectRootDirectory(true), @"Source\MSBuild.Community.Tasks.Tests\DependencyGraph\MSBuild.Community.Tasks.csproj");
            taskItemStub.Stub(ti => ti.GetMetadata("FullPath")).Return(taskItemStub.ItemSpec);

            var filterItemStub1 = MockRepository.GenerateStub <ITaskItem>();

            filterItemStub1.ItemSpec = @"System";

            var filterItemStub2 = MockRepository.GenerateStub <ITaskItem>();

            filterItemStub2.ItemSpec = @"Microsoft\.";

            var buildEngineStub = MockRepository.GenerateStub <IBuildEngine>();

            MSBuild.Community.Tasks.DependencyGraph.DependencyGraph task = new Tasks.DependencyGraph.DependencyGraph();
            task.BuildEngine = buildEngineStub;
            task.InputFiles  = new ITaskItem[] { taskItemStub };
            task.Filters     = new ITaskItem[] { filterItemStub1, filterItemStub2 };
            task.OutputFile  = "output.txt";
            task.Execute();

            string expectedOutput = GetFileContent(Path.Combine(TaskUtility.GetProjectRootDirectory(true), @"Source\MSBuild.Community.Tasks.Tests\DependencyGraph\outputgraph2.txt"));
            string taskOutput     = GetFileContent(task.OutputFile);

            Assert.IsNotNullOrEmpty(taskOutput);
            Assert.AreEqual(expectedOutput, taskOutput);
        }
Exemplo n.º 2
0
        public void TestWithoutInputFiles()
        {
            var buildEngineStub = MockRepository.GenerateStub <IBuildEngine>();

            MSBuild.Community.Tasks.DependencyGraph.DependencyGraph task = new Tasks.DependencyGraph.DependencyGraph();
            task.BuildEngine = buildEngineStub;
            task.Execute();
        }
            public bool Execute()
            {
                Tasks.DependencyGraph.DependencyGraph task = new Tasks.DependencyGraph.DependencyGraph();
                task.BuildEngine = _buildEngineStub;
                task.InputFiles = _taskItems;
                task.ExcludeReferences = _excludeRefereces;
                task.OutputFile = _outputFile;

                return task.Execute();
            }
Exemplo n.º 4
0
            public bool Execute()
            {
                Tasks.DependencyGraph.DependencyGraph task = new Tasks.DependencyGraph.DependencyGraph();
                task.BuildEngine       = _buildEngineStub;
                task.InputFiles        = _taskItems;
                task.ExcludeReferences = _excludeRefereces;
                task.OutputFile        = _outputFile;

                return(task.Execute());
            }
        public void TestWithoutInputFiles()
        {
            var buildEngineStub = MockRepository.GenerateStub<IBuildEngine>();

            MSBuild.Community.Tasks.DependencyGraph.DependencyGraph task = new Tasks.DependencyGraph.DependencyGraph();
            task.BuildEngine = buildEngineStub;
            task.Execute();
        }