public void FileAdapter_CleanTrash_should_leave_input_outpud_and_remove_sort_process_files() { var inputPath = "d:/temp/10G.1"; var outputPath = $"{inputPath}.sorted"; inputPath = Path.GetFullPath(inputPath); outputPath = Path.GetFullPath(outputPath); for (var i = 0; i < 10; i++) { using (var fs = File.Create($"{inputPath}.{i}")) { } } var fa = new FileAdapter(); fa.CleanSortTrash(inputPath, outputPath); var expected = new[] { inputPath, outputPath }; var actual = Directory .GetFiles(Path.GetDirectoryName(inputPath)) .Where(x => x.StartsWith(inputPath)) .ToArray(); Assert.Equal(expected, actual); }