public void GetItem_ReturnsNotFoundResult() { // Arrange var path = "/NotFound.cshtml"; var fileSystemProject = new FileSystemRazorProject(TestFolder); // Act var item = fileSystemProject.GetItem(path); // Assert Assert.False(item.Exists); }
public void GetItem_ReturnsFileFromDisk() { // Arrange var path = "/Views/About/About.cshtml"; var fileSystemProject = new FileSystemRazorProject(TestFolder); // Act var file = fileSystemProject.GetItem(path); // Assert Assert.True(file.Exists); Assert.Equal(path, file.FilePath); }
public void GetItem_ReturnsFileFromDisk() { // Arrange var filePath = "/Views/About/About.cshtml"; var fileSystemProject = new FileSystemRazorProject(TestFolder); // Act var item = fileSystemProject.GetItem(filePath); // Assert Assert.True(item.Exists); Assert.Equal(filePath, item.FilePath); Assert.Equal("/", item.BasePath); Assert.Equal(Path.Combine(TestFolder, "Views", "About", "About.cshtml"), item.PhysicalPath); Assert.Equal(Path.Combine("Views", "About", "About.cshtml"), item.RelativePhysicalPath); }