public void ExtractProjectionInfo_TwoActions() { string mockFileName = "User-Create-Edit.aspx"; ProjectionScanner scanner = new ProjectionScanner(); scanner.ControlLoader = new MockControlLoader(this, mockFileName); ProjectionInfo[] infos = scanner.ExtractProjectionInfo(mockFileName); Assert.AreEqual(2, infos.Length, "Invalid number of projections found."); }
public void Test_FindProjections() { string appName = "MockApplication"; ProjectionScanner scanner = new ProjectionScanner(); scanner.ControlLoader = new MockControlLoader(this, String.Empty); scanner.FileNamer.FileMapper = new MockFileMapper(this, TestUtilities.GetTestingPath(this), appName); scanner.FileNamer.ProjectionsDirectoryPath = TestUtilities.GetTestApplicationPath(this, appName) + Path.DirectorySeparatorChar + "Projections"; ProjectionInfo[] infos = scanner.FindProjections(); Assert.AreEqual(1, infos.Length, "Invalid number of projections found."); Assert.AreEqual("Edit", infos[0].Action, "The action doesn't match."); Assert.AreEqual("TestUser", infos[0].TypeName, "The type name doesn't match."); }
public void Test_GetFormatFromFileName_Xml() { string appName = "MockApplication"; ProjectionScanner scanner = new ProjectionScanner(); scanner.FileNamer.FileMapper = new MockFileMapper(this, TestUtilities.GetTestingPath(this), appName); scanner.FileNamer.ProjectionsDirectoryPath = TestUtilities.GetTestApplicationPath(this, appName) + Path.DirectorySeparatorChar + "Projections"; string fileName = "Test.xml.ascx"; ProjectionFormat format = new ProjectionInfoExtractor(null).GetFormatFromFileName(fileName); Assert.AreEqual(ProjectionFormat.Xml, format, "The format doesn't match what's expected."); }