public void BistroReflectionCorrect() { var dispatcher = new MethodDispatcher(Application.Instance); Assert.That(dispatcher.IsMethodDefined("GET/foo"), "Since there are wild-card mappings in the test apps, \"foo\" should return true"); Assert.That(!dispatcher.IsMethodDefinedExplicitly("GET/foobar"), "There isn't an explicit controller binding to \"foobar\""); Assert.That(dispatcher.IsMethodDefinedExplicitly("EVENT/bistro/application/startup"), "The application startup method is defined explicitly. Something's amiss"); }
/// <summary> /// Loads the factories. /// </summary> protected virtual void LoadFactories(SectionHandler section) { if (Application.Instance == null || !Application.Instance.Initialized) Application.Initialize(section); application = Application.Instance; logger = application.LoggerFactory.GetLogger(GetType()); methodDispatcher = new MethodDispatcher(application); }
/// <summary> /// Loads the factories. /// </summary> protected virtual void LoadFactories(SectionHandler section) { lock (moduleLock) { if (Application.Instance == null) Application.Initialize(section); } var _application = Application.Instance; logger = _application.LoggerFactory.GetLogger(GetType()); methodDispatcher = new MethodDispatcher(_application); }