Esempio n. 1
0
        public override void SetUp()
        {
            base.SetUp();

            WebRuntimeComponent.CreateRoutes(
                new TestUmbracoContextAccessor(),
                TestObjects.GetGlobalSettings(),
                new SurfaceControllerTypeCollection(Enumerable.Empty <Type>()),
                new UmbracoApiControllerTypeCollection(Enumerable.Empty <Type>()));
        }
        public void WrapViewEngines_HasProfiledEngine_AddsSameInstance()
        {
            var profiledEngine          = new ProfilingViewEngine(new PluginViewEngine());
            IList <IViewEngine> engines = new List <IViewEngine>
            {
                profiledEngine
            };

            WebRuntimeComponent.WrapViewEngines(engines);

            Assert.That(engines[0], Is.SameAs(profiledEngine));
        }
        public void WrapViewEngines_HasEngines_KeepsSortOrder()
        {
            IList <IViewEngine> engines = new List <IViewEngine>
            {
                new RenderViewEngine(),
                new PluginViewEngine()
            };

            WebRuntimeComponent.WrapViewEngines(engines);

            Assert.That(engines.Count, Is.EqualTo(2));
            Assert.That(((ProfilingViewEngine)engines[0]).Inner, Is.InstanceOf <RenderViewEngine>());
            Assert.That(((ProfilingViewEngine)engines[1]).Inner, Is.InstanceOf <PluginViewEngine>());
        }
        public void WrapViewEngines_HasEngines_WrapsAll()
        {
            IList <IViewEngine> engines = new List <IViewEngine>
            {
                new RenderViewEngine(),
                new PluginViewEngine()
            };

            WebRuntimeComponent.WrapViewEngines(engines);

            Assert.That(engines.Count, Is.EqualTo(2));
            Assert.That(engines[0], Is.InstanceOf <ProfilingViewEngine>());
            Assert.That(engines[1], Is.InstanceOf <ProfilingViewEngine>());
        }
 public void WrapViewEngines_CollectionIsNull_DoesNotThrow()
 {
     Assert.DoesNotThrow(() => WebRuntimeComponent.WrapViewEngines(null));
 }