public void Setup() { RootPath = Path.Join(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Guid.NewGuid().ToString()); FSStaticBuilder.EnsureDirectoryExists(RootPath); PostData = Enumerable.Range(0, Length).Select(x => Generator.GetPost()).ToArray(); LayoutData = Enumerable.Range(0, Length).Select(x => Generator.GetLayout()).ToArray(); PageData = Enumerable.Range(0, Length).Select(x => Generator.GetPage()).ToArray(); FileData = Enumerable.Range(0, Length).Select(x => Generator.GetFile()).ToArray(); Builder = new BlogBuilder(new BlogOptions(), RootPath); }
public async Task Setup() { RootPath = Path.Join(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "fstest"); FSStaticBuilder.EnsureDirectoryExists(RootPath); PostData = Enumerable.Range(0, 100).Select(x => Generator.GetPost()).ToArray(); LayoutData = Enumerable.Range(0, 100).Select(x => Generator.GetLayout()).ToArray(); PageData = Enumerable.Range(0, 100).Select(x => Generator.GetPage()).ToArray(); FileData = Enumerable.Range(0, 100).Select(x => Generator.GetFile()).ToArray(); BlogOptionsData = new BlogOptions(); BlogBuilder builder = new BlogBuilder(BlogOptionsData, RootPath); await builder.Build(); await builder.BuildPosts(PostData); await builder.BuildLayouts(LayoutData); await builder.BuildPages(PageData); await builder.BuildFiles(FileData); BlogService = new FileSystemBlogService(new PhysicalFileProvider(RootPath).AsFileProvider()); }
public void Cleanup() { FSStaticBuilder.EnsureDirectoryExists(RootPath, false); }
public RecordFSRepo(string rootPath) : base(rootPath) { FSStaticBuilder.EnsureDirectoryExists(rootPath); FileProvider = new PhysicalFileProvider(rootPath).AsFileProvider(); }