Esempio n. 1
0
        public void TestGetLastWriteTimeUtc()
        {
            var filename = Util.CreateNewFile(longPathDirectory);

            try
            {
                var dateTime = File.GetLastWriteTimeUtc(filename);
                var fi       = new FileInfo(filename);
                Assert.AreEqual(fi.LastWriteTimeUtc, dateTime);
            }
            finally
            {
                File.Delete(filename);
            }
        }
Esempio n. 2
0
        public void TestSetLastWriteTimeUtc()
        {
            var filename = Util.CreateNewFile(longPathDirectory);

            try
            {
                DateTime dateTime = DateTime.UtcNow.AddDays(1);
                var      fi       = new FileInfo(filename);
                fi.LastWriteTimeUtc = dateTime;
                Assert.AreEqual(dateTime, File.GetLastWriteTimeUtc(filename));
            }
            finally
            {
                File.Delete(filename);
            }
        }
Esempio n. 3
0
 public static DateTime GetLastWriteTimeUtc(string path)
 {
     return(File.GetLastWriteTimeUtc(path));
 }