public void TestFolderManager_GetLastestTime() { string path = "D:\\读写测试\\GetLastestTime"; FolderManager.DeleteDirectoryInfo(path); Assert.IsTrue(FolderManager.GetLastestTime(path) == DateTime.MinValue); new DirectoryInfo(path).Create(); Assert.IsTrue(FolderManager.GetLastestTime(path) == DateTime.MinValue); string fileName = Path.Combine(path, "text.txt"); new FileInfo(fileName).Create(); DateTime lastestTime = FolderManager.GetLastestTime(path); Assert.IsTrue(lastestTime < DateTime.Now); Assert.IsTrue(lastestTime.AddSeconds(1) > DateTime.Now); FolderManager.DeleteDirectoryInfo(path); }
private void updateLastWriteTime() { UpdateLastestTime = FolderManager.GetLastestTime(Path); }