public void TestGetTemplates(string dbContextClass, string userClass, bool isUsingExistingDbContext, bool isGenerateCustomUser, Predicate <IdentityGeneratorFile> excludeFilter, Predicate <IdentityGeneratorFile> includeFilter) { var templateModel = new IdentityGeneratorTemplateModel() { DbContextClass = dbContextClass, UserClass = userClass, IsUsingExistingDbContext = isUsingExistingDbContext, IsGenerateCustomUser = isGenerateCustomUser }; var templateFiles = IdentityGeneratorFilesConfig.GetFilesToGenerate(null, templateModel); if (excludeFilter != null) { Assert.DoesNotContain(templateFiles, excludeFilter); } if (includeFilter != null) { Assert.Contains(templateFiles, includeFilter); } }
public void TestExistingWwwRootDataIsNotOverwrittenWhenScaffoldAllFilesSelected() { IdentityGeneratorTemplateModel model = new IdentityGeneratorTemplateModel() { UseDefaultUI = false, HasExistingNonEmptyWwwRoot = true, SupportFileLocation = "\\tmp\\" }; IdentityGeneratorFile[] templateFiles = IdentityGeneratorFilesConfig.GetFilesToGenerate(null, model); Assert.DoesNotContain(templateFiles, x => x.SourcePath.IndexOf("wwwroot", StringComparison.OrdinalIgnoreCase) > -1); }