Ejemplo n.º 1
0
        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());
                }
            }
        }
Ejemplo n.º 2
0
        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();
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 模板相关API
        /// </summary>
        /// <param name="client"></param>
        static void checkTemplate(SignClient client)
        {
            TemplateTest test = new TemplateTest(client);

            test.runAllTest();
        }