diff --git a/TDD/SearchText/PathKeeper.cs b/TDD/SearchText/PathKeeper.cs index bc659d1..4e75629 100644 --- a/TDD/SearchText/PathKeeper.cs +++ b/TDD/SearchText/PathKeeper.cs @@ -30,12 +30,18 @@ private void SetPathList() { list[i] = Directory.GetFiles(this._pathToFolder)[i]; } - _pathList = list; + + _pathList = SortList(list); } - + + private string[] SortList(string[] list) + { + return list.OrderBy(x => x).ToArray(); + } + public string GetIthPath(int i) { - return this._pathList![i]; + return _pathList![i]; } public List GetPathOfCandidateIndexes(List input)