public void WithRestart() { var template = new TemplateTest(); using (var store = Store()) { using (var session = store.OpenSession()) { session.Store(template); session.SaveChanges(); } using (var session = store.OpenSession()) { Assert.Equal(1, session.Query <TemplateTests_Search.ReduceResult, TemplateTests_Search>().Count()); } } using (var store = Store()) { using (var session = store.OpenSession()) { Assert.Equal(1, session.Query <TemplateTests_Search.ReduceResult, TemplateTests_Search>().Count()); } } }
public async Task LoadTemplates() { Templates = new List <Template> { // async ? //TemplateTest.GetTemplate_1(), //TemplateTest.GetTemplate_2(), TemplateTest.GetTemplate_3(), TemplateTest.GetTemplate_4() }; //chargement des templates stockés dans les fichiers var storagelist = await FileManagement.GetTemplateFoldersList(); foreach (var stlist in storagelist) { var files = await stlist.GetFilesAsync(); foreach (var file in files) { if (Path.GetExtension(file.Name) == ".cv") { Resume.Template temp = await FileManagement.Read_template(Path.GetFileNameWithoutExtension(file.Name), stlist); Templates.Add(temp); } } } // Fill templates with defaults informations foreach (Template e in Templates) { e.UpdateFromIndex(); if (e.Fonts == null) { e.Fonts = Fonts.GetDefault(); } } }
/// <summary> /// 模板相关API /// </summary> /// <param name="client"></param> static void checkTemplate(SignClient client) { TemplateTest test = new TemplateTest(client); test.runAllTest(); }