Ejemplo n.º 1
0
        public void TestUpdateAccessTime()
        {
            DeleteExistingFile();

            _fileTracker.TrackFileAccess(_testFileName);
            _fileTracker.SaveStoredList();

            var properContents = "[{\"FileName\":\"" + _testFileName + "\",\"LastAccessTime\":" + _mockDateTimeProvider.Object.GetDateTime().Ticks + "}]";

            StreamReader reader       = new StreamReader(_mockConfig.Object.StorageFile);
            var          fileContents = reader.ReadToEnd();

            reader.Close();

            Assert.AreEqual(properContents, fileContents);
        }
Ejemplo n.º 2
0
 public void WriteFile(string fileName, byte[] data)
 {
     File.WriteAllBytes(GetFullPath(fileName), data);
     _fileTracker.TrackFileAccess(fileName);
 }