public void GetLayoutName_WithoutMasterSuffix_ReturnsNull() { // Arrange var testVirtualPath = "~/TestPrefix/TestTitle.test"; var pathDefinition = new PathDefinition(); pathDefinition.VirtualPath = "~/TestPrefix"; // Act var layoutVirtualPathBuilder = new LayoutVirtualPathBuilder(); var resultLayoutName = layoutVirtualPathBuilder.GetLayoutName(pathDefinition, testVirtualPath); // Assert Assert.IsNull(resultLayoutName, "The result layout name should be null if the virtual path doesn't end with 'master'."); }
public void GetLayoutName_VirtualPath_ResolvesLayoutFileName() { // Arrange var expectedLayoutName = "TestTitle"; var testVirtualPath = "~/TestPrefix/TestTitle....master"; var pathDefinition = new PathDefinition { VirtualPath = "~/TestPrefix" }; // Act var layoutVirtualPathBuilder = new LayoutVirtualPathBuilder(); var resultLayoutName = layoutVirtualPathBuilder.GetLayoutName(pathDefinition, testVirtualPath); // Assert Assert.AreEqual(expectedLayoutName, resultLayoutName, "The layout name is not extracted correctly."); }