public AllImplementationsAndTemplates() { IConfigurationRoot configuration = TestHelper.GetConfiguration(); var implementation = new MustacheTemplateService(configuration, new LoggerFactory().CreateLogger <MustacheTemplateService>()); _data = new [] { new object[] { implementation, Constants.Steeltoe24, Constants.NetCoreApp21, Constants.WebApi }, new object[] { implementation, Constants.Steeltoe24, Constants.NetCoreApp31, Constants.WebApi }, new object[] { implementation, Constants.Steeltoe30, Constants.NetCoreApp31, Constants.WebApi }, }.ToList(); }
public static IEnumerable <object[]> GetAllCombinations(Type templateServiceType, string templateName, TemplateVersion version, int take) { ITemplateService templateService; if (templateServiceType == typeof(MustacheTemplateService)) { templateService = new MustacheTemplateService( TestHelper.GetConfiguration(), new LoggerFactory().CreateLogger <MustacheTemplateService>()); } else { templateService = new TemplateService( TestHelper.GetConfiguration(), new MemoryCache(new MemoryCacheOptions()), new LoggerFactory().CreateLogger <TemplateService>()); } var dependencies = templateService.GetDependencies(templateName, version); return(from deps in GetCombinations(dependencies.Select(d => d.ShortName), take) select new object[] { templateService, templateName, version, string.Join(",", deps) }); }
public HomeController(IEnumerable <ITemplateService> services) { _templateService = services.OfType <MustacheTemplateService>().FirstOrDefault(); }
public TemplatesController(IEnumerable <ITemplateService> services) { // _templateService = services.OfType<TemplateService>().FirstOrDefault(); _sttemplateService = services.OfType <MustacheTemplateService>().FirstOrDefault(); }