Add RazorTemplate

This commit is contained in:
Mike Harder 2018-04-27 09:57:18 -07:00
parent 3a041176e9
commit 9ccf6501ef
3 changed files with 38 additions and 3 deletions

View File

@ -0,0 +1,37 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace AspNetCoreSdkTests.Templates
{
public class RazorTemplate : WebTemplate
{
public override string Name => "razor";
public override IEnumerable<string> ExpectedObjFilesAfterBuild => Enumerable.Concat(base.ExpectedObjFilesAfterBuild, new[]
{
$"{Name}.RazorCoreGenerate.cache",
$"{Name}.RazorTargetAssemblyInfo.cs",
$"{Name}.TagHelpers.input.cache",
$"{Name}.TagHelpers.output.cache",
$"{Name}.Views.dll",
$"{Name}.Views.pdb",
Path.Combine("Razor", "Pages", "_ViewImports.g.cshtml.cs"),
Path.Combine("Razor", "Pages", "_ViewStart.g.cshtml.cs"),
Path.Combine("Razor", "Pages", "About.g.cshtml.cs"),
Path.Combine("Razor", "Pages", "Contact.g.cshtml.cs"),
Path.Combine("Razor", "Pages", "Error.g.cshtml.cs"),
Path.Combine("Razor", "Pages", "Index.g.cshtml.cs"),
Path.Combine("Razor", "Pages", "Privacy.g.cshtml.cs"),
Path.Combine("Razor", "Pages", "Shared", "_CookieConsentPartial.g.cshtml.cs"),
Path.Combine("Razor", "Pages", "Shared", "_Layout.g.cshtml.cs"),
Path.Combine("Razor", "Pages", "Shared", "_ValidationScriptsPartial.g.cshtml.cs"),
}.Select(p => Path.Combine(OutputPath, p)));
public override IEnumerable<string> ExpectedBinFilesAfterBuild => Enumerable.Concat(base.ExpectedBinFilesAfterBuild, new[]
{
$"{Name}.Views.dll",
$"{Name}.Views.pdb",
}.Select(p => Path.Combine(OutputPath, p)));
}
}

View File

@ -9,6 +9,7 @@ namespace AspNetCoreSdkTests.Templates
new ClassLibraryTemplate(),
new ConsoleApplicationTemplate(),
new WebTemplate(),
new RazorTemplate(),
};
}
}

View File

@ -8,14 +8,11 @@ namespace AspNetCoreSdkTests.Templates
{
public override string Name => "web";
public override TemplateType Type => TemplateType.Application;
public override IEnumerable<string> ExpectedObjFilesAfterBuild => Enumerable.Concat(base.ExpectedObjFilesAfterBuild, new[]
{
$"{Name}.RazorAssemblyInfo.cache",
$"{Name}.RazorAssemblyInfo.cs",
$"{Name}.RazorTargetAssemblyInfo.cache",
}.Select(p => Path.Combine(OutputPath, p)));
}
}