Esempio n. 1
0
        public void NormalizePath_AppendsLeadingSlash(string input)
        {
            // Act
            var normalizedPath = ViewPath.NormalizePath(input);

            // Assert
            Assert.Equal("/Views/Home/Index.cshtml", normalizedPath);
        }
Esempio n. 2
0
        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);
        }