Exemple #1
0
            public Facts(ITestOutputHelper output)
            {
                _directory = Path.Combine(Path.GetTempPath(), "NuGet.Services.Build.Tests", Guid.NewGuid().ToString("N"));
                Directory.CreateDirectory(_directory);

                BuildEngine = new Mock <IBuildEngine>();
                Files       = new List <ITaskItem>();

                BuildEngine
                .Setup(x => x.LogCustomEvent(It.IsAny <CustomBuildEventArgs>()))
                .Callback <CustomBuildEventArgs>(e => output.WriteLine($"[CUSTOM] {e.SenderName}: {e.Message}"));
                BuildEngine
                .Setup(x => x.LogErrorEvent(It.IsAny <BuildErrorEventArgs>()))
                .Callback <BuildErrorEventArgs>(e => output.WriteLine($"[ERROR] {e.SenderName}: {e.Message}"));
                BuildEngine
                .Setup(x => x.LogMessageEvent(It.IsAny <BuildMessageEventArgs>()))
                .Callback <BuildMessageEventArgs>(e => output.WriteLine($"[MESSAGE] {e.SenderName}: {e.Message}"));
                BuildEngine
                .Setup(x => x.LogWarningEvent(It.IsAny <BuildWarningEventArgs>()))
                .Callback <BuildWarningEventArgs>(e => output.WriteLine($"[WARNING] {e.SenderName}: {e.Message}"));

                Target             = new FindDuplicateFiles();
                Target.BuildEngine = BuildEngine.Object;
                Target.Files       = Files.ToArray();
            }
Exemple #2
0
        public void CorrectlyReturnsTheDuplicatedFiles()
        {
            var rootPath = System.IO.Directory.GetCurrentDirectory();
            var actual   = FindDuplicateFiles.GetDuplicates(rootPath).ToList();

            actual.ShouldNotBeEmpty();
        }