public ViewEngineStartupContext(IViewCache viewCache, IEnumerable <ViewLocationResult> viewLocationCache, IEnumerable <string> extensions) { this.viewLocationCache = viewLocationCache; this.Extensions = extensions; this.ViewCache = viewCache; this.availableViews = GetViewsThatEngineCanRender(this.viewLocationCache, this.Extensions); }
public ViewEngineStartupContext(IViewCache viewCache, IEnumerable<ViewLocationResult> viewLocationCache, IEnumerable<string> extensions) { this.viewLocationCache = viewLocationCache; this.extensions = extensions; this.ViewCache = viewCache; this.availableViews = GetViewsThatEngineCanRender(this.viewLocationCache, this.extensions); }
/// <summary> /// Initializes a new instance of the <see cref="DefaultRenderContext"/> class. /// </summary> /// <param name="viewResolver"></param> /// <param name="viewCache"></param> /// <param name="textResource"></param> /// <param name="viewLocationContext"></param> public DefaultRenderContext(IViewResolver viewResolver, IViewCache viewCache, ITextResource textResource, ViewLocationContext viewLocationContext) { this.viewResolver = viewResolver; this.viewCache = viewCache; this.textResource = textResource; this.viewLocationContext = viewLocationContext; this.textResourceFinder = new TextResourceFinder(textResource, viewLocationContext.Context); }
public static void GuardInit(Assembly assembly) { lock (_cacheLock) { if (Cache != null) { return; } Cache = new T().GuardInit(assembly); if (!Cache.IsRegisterd(Html.HTML_GROUP_NAME)) { Cache.Register(new Html()); } if (!Cache.IsRegisterd(Tiles.Tags.Tiles.TILES_GROUP_NAME)) { Cache.Register(new Tiles.Tags.Tiles()); } } }
public ViewEngineStartupFixture() { this.views = new List<ViewLocationResult> { new ViewLocationResult("", "", "html", null), new ViewLocationResult("", "", "spark", null), }; var viewLocationProvider = A.Fake<IViewLocationProvider>(); A.CallTo(() => viewLocationProvider.GetLocatedViews(A<IEnumerable<string>>._)) .Returns(views); var viewEngine = A.Fake<IViewEngine>(); A.CallTo(() => viewEngine.Extensions).Returns(new[] { "liquid" }); this.viewLocator = new DefaultViewLocator(viewLocationProvider, new[] { viewEngine }); this.viewCache = A.Fake<IViewCache>(); }
public ViewEngineStartupFixture() { this.views = new List <ViewLocationResult> { new ViewLocationResult("", "", "html", null), new ViewLocationResult("", "", "spark", null), }; var viewLocationProvider = A.Fake <IViewLocationProvider>(); A.CallTo(() => viewLocationProvider.GetLocatedViews(A <IEnumerable <string> > ._)) .Returns(views); var viewEngine = A.Fake <IViewEngine>(); A.CallTo(() => viewEngine.Extensions).Returns(new[] { "liquid" }); this.viewLocator = new DefaultViewLocator(viewLocationProvider, new[] { viewEngine }); this.viewCache = A.Fake <IViewCache>(); }
public NancyViewFolderFixture() { this.cache = A.Fake<IViewCache>(); this.environment = new DefaultNancyEnvironment(); this.environment.AddValue(ViewConfiguration.Default); }
public ViewEngineStartupContext(IViewCache viewCache, IEnumerable <ViewLocationResult> viewLocationResults) { this.ViewCache = viewCache; this.ViewLocationResults = viewLocationResults; }
public NancyViewFolderFixture() { this.cache = A.Fake <IViewCache>(); this.environment = new DefaultNancyEnvironment(); this.environment.AddValue(ViewConfiguration.Default); }
public void SetUp() { _cache = new TilesCache().GuardInit(Assembly.GetAssembly(typeof(HomeController))); }
/// <summary> /// Initializes a new instance of the <see cref="DefaultRenderContext"/> class. /// </summary> /// <param name="viewResolver"></param> /// <param name="viewCache"></param> /// <param name="viewLocationContext"></param> public DefaultRenderContext(IViewResolver viewResolver, IViewCache viewCache, ViewLocationContext viewLocationContext) { this.viewResolver = viewResolver; this.viewCache = viewCache; this.viewLocationContext = viewLocationContext; }
public OutputEqualsConstraint From(IViewCache cache) { _cache = cache; return(this); }
public TilesView(string viewName, IViewCache cache) : this(viewName, cache, false) { }
public OutputEqualsConstraint From(IViewCache cache) { _cache = cache; return this; }
public void SetUp() { _cache = new TilesCache(); _cache.Register(new Tiles.Tags.Tiles()); _cache.GuardInit(Assembly.GetAssembly(typeof(OutputConstraintTest))); }
public TilesView(string viewName, IViewCache cache, bool httpErrors) { _viewName = viewName; _cache = cache; HttpErrors = httpErrors; }
/// <summary> /// Initializes a new instance of the <see cref="DefaultRenderContextFactory"/> class. /// </summary> /// <param name="viewCache">The view cache that should be used by the created render context.</param> /// <param name="viewResolver">The view resolver that should be sused by the created render context.</param> public DefaultRenderContextFactory(IViewCache viewCache, IViewResolver viewResolver) { this.viewCache = viewCache; this.viewResolver = viewResolver; }
public ViewEngineStartupFixture() { this.viewCache = A.Fake <IViewCache>(); this.viewLocationCache = A.Fake <IViewLocationCache>(); A.CallTo(() => this.viewLocationCache.GetEnumerator()).ReturnsLazily(() => this.views.GetEnumerator()); }
/// <summary> /// Initializes a new instance of the <see cref="ViewEngineApplicationStartup"/> class, with the /// provided <paramref name="viewEngines"/>, <paramref name="viewLocationCache"/> and <paramref name="viewCache"/>. /// </summary> /// <param name="viewEngines">The available view engines.</param> /// <param name="viewCache">The view cache.</param> /// <param name="viewLocator">The view locator.</param> public ViewEngineApplicationStartup(IEnumerable <IViewEngine> viewEngines, IViewCache viewCache, IViewLocator viewLocator) { this.viewEngines = viewEngines; this.viewCache = viewCache; this.viewLocator = viewLocator; }
public ViewEngineStartup(IEnumerable<IViewEngine> viewEngines, IViewLocationCache viewLocationCache, IViewCache viewCache) { this.viewEngines = viewEngines; this.viewLocationCache = viewLocationCache; this.viewCache = viewCache; }
public NancyViewFolderFixture() { this.cache = A.Fake<IViewCache>(); this.extensions = new[] {"spark"}; }
public ViewEngineStartupContext(IViewCache viewCache, IViewLocator viewLocator) { this.ViewLocator = viewLocator; this.ViewCache = viewCache; }
/// <summary> /// Initializes a new instance of the <see cref="DefaultRenderContextFactory"/> class. /// </summary> /// <param name="viewCache">The view cache that should be used by the created render context.</param> /// <param name="viewResolver">The view resolver that should be sused by the created render context.</param> /// <param name="textResource">The <see cref="ITextResource"/> that should be used by the engine.</param> public DefaultRenderContextFactory(IViewCache viewCache, IViewResolver viewResolver, ITextResource textResource) { this.viewCache = viewCache; this.viewResolver = viewResolver; this.textResource = textResource; }
public ViewEngineStartupFixture() { this.viewCache = A.Fake<IViewCache>(); this.viewLocationCache = A.Fake<IViewLocationCache>(); A.CallTo(() => this.viewLocationCache.GetEnumerator()).ReturnsLazily(() => this.views.GetEnumerator()); }
/// <summary> /// Initializes a new instance of the <see cref="ViewEngineApplicationStartup"/> class, with the /// provided <paramref name="viewEngines"/>, <paramref name="viewCache"/> and <paramref name="viewLocator"/>. /// </summary> /// <param name="viewEngines">The available view engines.</param> /// <param name="viewCache">The view cache.</param> /// <param name="viewLocator">The view locator.</param> public ViewEngineApplicationStartup(IEnumerable<IViewEngine> viewEngines, IViewCache viewCache, IViewLocator viewLocator) { this.viewEngines = viewEngines; this.viewCache = viewCache; this.viewLocator = viewLocator; }
public ViewEngineStartup(IEnumerable <IViewEngine> viewEngines, IViewLocationCache viewLocationCache, IViewCache viewCache) { this.viewEngines = viewEngines; this.viewLocationCache = viewLocationCache; this.viewCache = viewCache; }
public NancyViewFolderFixture() { this.cache = A.Fake <IViewCache>(); this.extensions = new[] { "spark" }; }