public void DeleteUnusedFiles() { var unusedFileNames = _fileTracker.GetUnusedFiles(); foreach (var fileName in unusedFileNames) { DeleteFile(fileName); } }
public void TestGetUnusedFiles() { var testList = new List <string>(); for (int i = 0; i < 3; i++) { testList.Add(_testFileName + i); } foreach (var fileName in testList) { _fileTracker.TrackFileAccess(fileName); } var unusedFiles = _fileTracker.GetUnusedFiles(); Assert.AreEqual(testList, unusedFiles); }