Ejemplo n.º 1
0
        public void ShouldSetNavigatorIfINavigationAwareIsImplemented()
        {
            var request = RequestBuilder.CreateRequest();
            var result  = new SampleViewEngineResult <ReallySmartView>(new ViewResultOptions(), request.BuildControllerContext());

            result.Render();

            Assert.AreEqual(request.Navigator.Object, result.View.Navigator);
        }
Ejemplo n.º 2
0
        public void ShouldSetDataContextIfIViewIsNotImplemented()
        {
            var request = RequestBuilder.CreateRequest();

            var result = new SampleViewEngineResult <DumbView>(new ViewResultOptions(new { Model = "hello" }), request.BuildControllerContext());

            result.Render();

            Assert.AreEqual("hello", result.View.DataContext);
        }