private bool DayEntryFileExists(string directory, DateTime dt) { var fileName = TestDataProcesor.GetBlogEntryFileName(dt); var path = Path.Combine(directory, fileName); return(File.Exists(path)); }
/// <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> private void SaveEntryDirect(IBlogManager blogManager, 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); }