Пример #1
0
        public void NormalizeAndEnsureValidPath_ThrowsIfPathIsNullOrEmpty(string path)
        {
            // Arrange
            var project = new TestRazorProject();

            // Act and Assert
            ExceptionAssert.ThrowsArgumentNullOrEmptyString(() => project.NormalizeAndEnsureValidPath(path), "path");
        }
Пример #2
0
        public void NormalizeAndEnsureValidPath_ThrowsIfPathDoesNotStartWithForwardSlash(string path)
        {
            // Arrange
            var project = new TestRazorProject();

            // Act and Assert
            ExceptionAssert.ThrowsArgument(
                () => project.NormalizeAndEnsureValidPath(path),
                "path",
                "Path must begin with a forward slash '/'.");
        }
Пример #3
0
        public void NormalizeAndEnsureValidPath_DoesNotModifyPath()
        {
            // Arrange
            var project = new TestRazorProject();

            // Act
            var path = project.NormalizeAndEnsureValidPath("/Views/Home/Index.cshtml");

            // Assert
            Assert.Equal("/Views/Home/Index.cshtml", path);
        }