public void AddOutputFileHandlesBadPaths() { var outputFolderPredictions = new List <string>(); var predictionFailures = new ConcurrentQueue <(string predictorName, string failure)>(); var collector = new MsBuildOutputPredictionCollector(outputFolderPredictions, predictionFailures); collector.AddOutputFile("!@#$%^&*()\0", TemporaryDirectory, "Mock"); Assert.Equal(0, outputFolderPredictions.Count); Assert.Equal(1, predictionFailures.Count); Assert.Equal("Mock", predictionFailures.Single().predictorName); Assert.Contains("!@#$%^&*()\0", predictionFailures.Single().failure); }
public void AddOutputDirectoryHandlesAbsolutePaths() { string absoluteDirectoryPath = Path.Combine(TemporaryDirectory, Guid.NewGuid().ToString()); var outputFolderPredictions = new List <string>(); var predictionFailures = new ConcurrentQueue <(string predictorName, string failure)>(); var collector = new MsBuildOutputPredictionCollector(outputFolderPredictions, predictionFailures); collector.AddOutputDirectory(absoluteDirectoryPath, TemporaryDirectory, "Mock"); Assert.Equal(1, outputFolderPredictions.Count); Assert.Contains(absoluteDirectoryPath, outputFolderPredictions); Assert.Equal(0, predictionFailures.Count); }