Exemple #1
0
        public void DeleteUnusedFiles()
        {
            var unusedFileNames = _fileTracker.GetUnusedFiles();

            foreach (var fileName in unusedFileNames)
            {
                DeleteFile(fileName);
            }
        }
Exemple #2
0
        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);
        }