public void GetAvailableTemplates_returnsTemplates() { var templates = new DotnetTemplateService(_loggerFactory.CreateLogger <DotnetTemplateService>()) .GetAvailableTemplates(); Assert.NotNull(templates); Assert.NotEmpty(templates); Assert.Contains(templates, x => x.ShortName == "Steeltoe-WebApi" && x.DotnetTemplateVersion == DotnetTemplateVersion.V2); Assert.Contains(templates, x => x.ShortName == "Steeltoe-WebApi" && x.DotnetTemplateVersion == DotnetTemplateVersion.V3); Assert.Contains(templates, x => x.ShortName == "Steeltoe-React" && x.DotnetTemplateVersion == DotnetTemplateVersion.V2); Assert.Contains(templates, x => x.ShortName == "Steeltoe-React" && x.DotnetTemplateVersion == DotnetTemplateVersion.V3); }
public static IEnumerable <object[]> GetAllCombinations(Type templateServiceType, string templateName, DotnetTemplateVersion version, int take) { ITemplateService templateService; if (templateServiceType == typeof(MustacheTemplateService)) { templateService = new MustacheTemplateService( TestHelper.GetConfiguration(), new LoggerFactory().CreateLogger <MustacheTemplateService>()); } else { templateService = new DotnetTemplateService( TestHelper.GetConfiguration(), new MemoryCache(new MemoryCacheOptions()), new LoggerFactory().CreateLogger <DotnetTemplateService>()); } 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) }); }