public async Task RecentTemplates_TwoTemplatesInGroupDifferentLanguage_TreatedAsDifferentRecentTemplate()
        {
            CreateCategories("android", "app", "general");
            CreateCategorizer();
            SolutionTemplate template1 = AddTemplate("template-id1", "android/app/general");

            template1.GroupId  = "console";
            template1.Language = "C#";
            SolutionTemplate template2 = AddTemplate("template-id2", "android/app/general");

            template2.GroupId  = "console";
            template2.Language = "F#";
            CategorizeTemplates();
            recentlyUsedTemplatesFile = GetRecentlyUsedTemplatesFileName("TwoTemplatesInGroupDifferentLanguage.xml");
            var recentTemplates            = new RecentTemplates(recentlyUsedTemplatesFile);
            var initialRecentTemplatesList = recentTemplates.GetTemplates(categorizedTemplates);

            recentTemplates.AddTemplate(template1);
            recentTemplates.AddTemplate(template2);

            var recentTemplatesList = await GetRecentTemplates(recentTemplates, categorizedTemplates, 2);

            Assert.AreEqual(0, initialRecentTemplatesList.Count);
            Assert.AreEqual(2, recentTemplatesList.Count);
            Assert.AreEqual(template2, recentTemplatesList[0]);
            Assert.AreEqual(template1, recentTemplatesList[1]);
        }
Beispiel #2
0
        public ProcessedTemplateResult ProcessTemplate(SolutionTemplate template, NewProjectConfiguration config, SolutionFolder parentFolder)
        {
            IProjectTemplatingProvider provider = GetTemplatingProviderForTemplate(template);

            if (provider != null)
            {
                var result = provider.ProcessTemplate(template, config, parentFolder);
                if (result.WorkspaceItems.Any())
                {
                    RecentTemplates.AddTemplate(template);
                }
                return(result);
            }
            return(null);
        }