Exemplo n.º 1
0
 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);
 }
Exemplo n.º 4
0
 /// <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);
 }
Exemplo n.º 5
0
 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());
         }
     }
 }
Exemplo n.º 6
0
        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>();
        }
Exemplo n.º 7
0
        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>();
        }
Exemplo n.º 8
0
 public NancyViewFolderFixture()
 {
     this.cache = A.Fake<IViewCache>();
     this.environment = new DefaultNancyEnvironment();
     this.environment.AddValue(ViewConfiguration.Default);
 }
Exemplo n.º 9
0
 public ViewEngineStartupContext(IViewCache viewCache, IEnumerable <ViewLocationResult> viewLocationResults)
 {
     this.ViewCache           = viewCache;
     this.ViewLocationResults = viewLocationResults;
 }
Exemplo n.º 10
0
 public NancyViewFolderFixture()
 {
     this.cache       = A.Fake <IViewCache>();
     this.environment = new DefaultNancyEnvironment();
     this.environment.AddValue(ViewConfiguration.Default);
 }
Exemplo n.º 11
0
 public void SetUp()
 {
     _cache = new TilesCache().GuardInit(Assembly.GetAssembly(typeof(HomeController)));
 }
Exemplo n.º 12
0
 public void SetUp()
 {
     _cache = new TilesCache().GuardInit(Assembly.GetAssembly(typeof(HomeController)));
 }
Exemplo n.º 13
0
 /// <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);
 }
Exemplo n.º 15
0
 public TilesView(string viewName, IViewCache cache) : this(viewName, cache, false)
 {
 }
Exemplo n.º 16
0
 public TilesView(string viewName, IViewCache cache)
     : this(viewName, cache, false)
 {
 }
Exemplo n.º 17
0
 /// <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;
 }
Exemplo n.º 18
0
 public OutputEqualsConstraint From(IViewCache cache)
 {
     _cache = cache;
     return this;
 }
Exemplo n.º 19
0
 public void SetUp()
 {
     _cache = new TilesCache();
     _cache.Register(new Tiles.Tags.Tiles());
     _cache.GuardInit(Assembly.GetAssembly(typeof(OutputConstraintTest)));
 }
Exemplo n.º 20
0
 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;
 }
Exemplo n.º 22
0
 public ViewEngineStartupFixture()
 {
     this.viewCache         = A.Fake <IViewCache>();
     this.viewLocationCache = A.Fake <IViewLocationCache>();
     A.CallTo(() => this.viewLocationCache.GetEnumerator()).ReturnsLazily(() => this.views.GetEnumerator());
 }
Exemplo n.º 23
0
 /// <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;
 }
 /// <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;
 }
Exemplo n.º 25
0
 public ViewEngineStartup(IEnumerable<IViewEngine> viewEngines, IViewLocationCache viewLocationCache, IViewCache viewCache)
 {
     this.viewEngines = viewEngines;
     this.viewLocationCache = viewLocationCache;
     this.viewCache = viewCache;
 }
Exemplo n.º 26
0
 public NancyViewFolderFixture()
 {
     this.cache = A.Fake<IViewCache>();
     this.extensions = new[] {"spark"};
 }
Exemplo n.º 27
0
 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;
 }
 /// <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;
 }
Exemplo n.º 30
0
 public TilesView(string viewName, IViewCache cache, bool httpErrors)
 {
     _viewName = viewName;
     _cache = cache;
     HttpErrors = httpErrors;
 }
Exemplo n.º 31
0
 public void SetUp()
 {
     _cache = new TilesCache();
     _cache.Register(new Tiles.Tags.Tiles());
     _cache.GuardInit(Assembly.GetAssembly(typeof(OutputConstraintTest)));
 }
Exemplo n.º 32
0
 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;
 }
Exemplo n.º 34
0
 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;
 }