예제 #1
0
        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();
        }
예제 #2
0
        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) });
        }
예제 #3
0
 public HomeController(IEnumerable <ITemplateService> services)
 {
     _templateService = services.OfType <MustacheTemplateService>().FirstOrDefault();
 }
예제 #4
0
 public TemplatesController(IEnumerable <ITemplateService> services)
 {
     // _templateService = services.OfType<TemplateService>().FirstOrDefault();
     _sttemplateService = services.OfType <MustacheTemplateService>().FirstOrDefault();
 }