Exemple #1
0
        public void NoOutputsReportedIfNoOutDirOrOutputPath()
        {
            Project         project         = CreateTestProject(null, null);
            ProjectInstance projectInstance = project.CreateProjectInstance(ProjectInstanceSettings.ImmutableWithFastItemLookup);
            var             predictor       = new OutDirOrOutputPathIsOutputDir();
            bool            hasPredictions  = predictor.TryPredictInputsAndOutputs(project, projectInstance, @"C:\repo", out _);

            Assert.False(hasPredictions, "Predictor should have fallen back to returning no predictions if OutDir and OutputPath are not defined in project");
        }
Exemple #2
0
        public void OutputPathUsedAsFallback()
        {
            const string    outputPath      = @"C:\repo\OutputPath";
            Project         project         = CreateTestProject(null, outputPath);
            ProjectInstance projectInstance = project.CreateProjectInstance(ProjectInstanceSettings.ImmutableWithFastItemLookup);
            var             predictor       = new OutDirOrOutputPathIsOutputDir();
            bool            hasPredictions  = predictor.TryPredictInputsAndOutputs(project, projectInstance, @"C:\repo", out StaticPredictions predictions);

            Assert.True(hasPredictions);
            predictions.AssertPredictions(null, new[] { new BuildOutputDirectory(outputPath) });
        }