Пример #1
0
        public static bool DayFeedbackFileExists(string directory, DateTime dt)
        {
            var fileName = TestDataProcesor.GetBlogFeedbackFileName(dt);
            var path     = Path.Combine(directory, fileName);

            return(File.Exists(path));
        }
Пример #2
0
        /// <summary>
        /// writes day entry file into the content directory
        /// </summary>
        /// <param name="blogManager"></param>
        /// <param name="directory">e.g. c:/projects/dasblog-core.../Environments/Vanilla/content</param>
        /// <param name="entryId"></param>
        public static void SaveEntryDirect(string directory, string entryId = null)
        {
            var fileName = TestDataProcesor.GetBlogEntryFileName(DateTime.Today);
            var path     = Path.Combine(directory, fileName);
            var str      = string.Format(minimalBlogPostXml
                                         , DateTime.Today.ToString("s", CultureInfo.InvariantCulture)
                                         , DateTime.Now.ToString("s", CultureInfo.InvariantCulture)
                                         , DateTime.Now.ToString("s", CultureInfo.InvariantCulture)
                                         , entryId ?? Guid.NewGuid().ToString());

            File.WriteAllText(path, str);
//			new CacheFixer().InvalidateCache(blogManager);
        }