public void NormalizePath_AppendsLeadingSlash(string input) { // Act var normalizedPath = ViewPath.NormalizePath(input); // Assert Assert.Equal("/Views/Home/Index.cshtml", normalizedPath); }
private string GetNormalizedPath(string relativePath) { Debug.Assert(relativePath != null); if (relativePath.Length == 0) { return(relativePath); } if (!_normalizedPathCache.TryGetValue(relativePath, out var normalizedPath)) { normalizedPath = ViewPath.NormalizePath(relativePath); _normalizedPathCache[relativePath] = normalizedPath; } return(normalizedPath); }