Update names and spacing of some missed ChunkTree renames.

This commit is contained in:
N. Taylor Mullen 2015-05-29 23:07:55 -07:00
parent 951a1d0879
commit e0b8532735
4 changed files with 19 additions and 18 deletions

View File

@ -49,9 +49,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives
{
// If there's more than 1 model chunk there will be a Razor error BUT we want intellisense to show up on
// the current model chunk that the user is typing.
return chunkTree.Chunks
.OfType<ModelChunk>()
.LastOrDefault();
return chunkTree
.Chunks
.OfType<ModelChunk>()
.LastOrDefault();
}
/// <summary>

View File

@ -45,12 +45,12 @@ namespace Microsoft.AspNet.Mvc.Razor
private readonly RazorPathNormalizer _pathNormalizer;
private ChunkInheritanceUtility _chunkInheritanceUtility;
internal MvcRazorHost(IChunkTreeCache ChunkTreeCache, RazorPathNormalizer pathNormalizer)
internal MvcRazorHost(IChunkTreeCache chunkTreeCache, RazorPathNormalizer pathNormalizer)
: base(new CSharpRazorCodeLanguage())
{
_pathNormalizer = pathNormalizer;
_baseType = BaseType;
_chunkTreeCache = ChunkTreeCache;
_chunkTreeCache = chunkTreeCache;
TagHelperDescriptorResolver = new TagHelperDescriptorResolver();
DefaultBaseClass = BaseType + "<" + DefaultModel + ">";
@ -124,11 +124,11 @@ namespace Microsoft.AspNet.Mvc.Razor
}
#endif
/// <summary>
/// Initializes a new instance of <see cref="MvcRazorHost"/> using the specified <paramref name="ChunkTreeCache"/>.
/// Initializes a new instance of <see cref="MvcRazorHost"/> using the specified <paramref name="chunkTreeCache"/>.
/// </summary>
/// <param name="ChunkTreeCache">An <see cref="IChunkTreeCache"/> rooted at the application base path.</param>
public MvcRazorHost(IChunkTreeCache ChunkTreeCache)
: this(ChunkTreeCache, new RazorPathNormalizer())
/// <param name="chunkTreeCache">An <see cref="IChunkTreeCache"/> rooted at the application base path.</param>
public MvcRazorHost(IChunkTreeCache chunkTreeCache)
: this(chunkTreeCache, new RazorPathNormalizer())
{
}

View File

@ -39,10 +39,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives
// Assert
Assert.Collection(chunkTrees,
ChunkTree =>
chunkTree =>
{
var viewImportsPath = @"Views\home\_ViewImports.cshtml";
Assert.Collection(ChunkTree.Chunks,
Assert.Collection(chunkTree.Chunks,
chunk =>
{
Assert.IsType<LiteralChunk>(chunk);
@ -60,10 +60,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives
Assert.Equal(viewImportsPath, chunk.Start.FilePath);
});
},
ChunkTree =>
chunkTree =>
{
var viewImportsPath = @"Views\_ViewImports.cshtml";
Assert.Collection(ChunkTree.Chunks,
Assert.Collection(chunkTree.Chunks,
chunk =>
{
Assert.IsType<LiteralChunk>(chunk);

View File

@ -31,7 +31,7 @@ namespace Microsoft.AspNet.Mvc.Razor
var rootedAppPath = $"{rootPrefix}SomeComputer/Location/Project/";
var rootedFilePath = $"{rootPrefix}SomeComputer/Location/Project/src/file.cshtml";
var host = new MvcRazorHost(
ChunkTreeCache: null,
chunkTreeCache: null,
pathNormalizer: new DesignTimeRazorPathNormalizer(rootedAppPath));
var parser = new RazorParser(
host.CodeLanguage.CreateCodeParser(),
@ -59,10 +59,10 @@ namespace Microsoft.AspNet.Mvc.Razor
var rootedAppPath = $"{rootPrefix}SomeComputer/Location/Project/";
var rootedFilePath = $"{rootPrefix}SomeComputer/Location/Project/src/file.cshtml";
var host = new MvcRazorHost(
ChunkTreeCache: null,
chunkTreeCache: null,
pathNormalizer: new DesignTimeRazorPathNormalizer(rootedAppPath));
var chunkInheritanceUtility = new PathValidatingChunkInheritanceUtility(host);
var CodeGeneratorContext = new CodeGeneratorContext(
var codeGeneratorContext = new CodeGeneratorContext(
new ChunkGeneratorContext(
host,
host.DefaultClassName,
@ -70,11 +70,11 @@ namespace Microsoft.AspNet.Mvc.Razor
rootedFilePath,
shouldGenerateLinePragmas: true),
new ErrorSink());
var codeGenerator = new CSharpCodeGenerator(CodeGeneratorContext);
var codeGenerator = new CSharpCodeGenerator(codeGeneratorContext);
host.ChunkInheritanceUtility = chunkInheritanceUtility;
// Act
host.DecorateCodeGenerator(codeGenerator, CodeGeneratorContext);
host.DecorateCodeGenerator(codeGenerator, codeGeneratorContext);
// Assert
Assert.Equal("src/file.cshtml", chunkInheritanceUtility.InheritedChunkTreePagePath, StringComparer.Ordinal);