public void Reset() { // Dispose the in-memory state new ControllersDisposer().Dispose(); string path = new ControllerFileNamer().ControllersInfoFilePath; File.Delete(path); // Now the controllers can be re-scanned and re-initialized }
public void Reset() { // Dispose the in-memory state new ControllersDisposer().Dispose(); string path = new ControllerFileNamer().ControllersInfoFilePath; File.Delete(path); // Now the controllers can be re-scanned and re-initialized }
// TODO: Remove if not needed /*[Test] public void ExtractControllerInfo_OneAction() { string mockFileName = "User-Create.aspx"; ControllerScanner scanner = new ControllerScanner(); ControllerInfo[] infos = scanner.ExtractControllerInfo(mockFileName); Assert.AreEqual(1, infos.Length, "Invalid number of controllers found."); } [Test] public void ExtractControllerInfo_TwoActions() { string mockFileName = "User-Create-Edit.aspx"; ControllerScanner scanner = new ControllerScanner(); ControllerInfo[] infos = scanner.ExtractControllerInfo(mockFileName); Assert.AreEqual(2, infos.Length, "Invalid number of controllers found."); }*/ /// <summary> /// Creates mock controllers that can be used during testing. /// </summary> public void CreateMockControllers(ControllerFileNamer namer) { throw new NotImplementedException(); ControllerInfo info1 = new ControllerInfo(); info1.Action = "Create"; info1.TypeName = "User"; info1.ControllerType = "Test"; /*string controller1Path = namer.CreateInfoFilePath(info1); if (!Directory.Exists(Path.GetDirectoryName(controller1Path))) Directory.CreateDirectory(Path.GetDirectoryName(controller1Path)); using (StreamWriter writer = File.CreateText(controller1Path)) { writer.Write("[mock content]"); writer.Close(); }*/ }