Exemplo n.º 1
0
        public void FindView_ShouldPassViewNameToView()
        {
            JsonViewEngine engine = new JsonViewEngine();
            ViewEngineResult result = engine.FindView(ContextForJson(), "someViewName", "", false);

            // This is not ideal, but since JsonViewEngine only returns JsonViews, we can't stub these
            Assert.AreEqual("someViewName", ((JsonView)result.View).ViewName);
        }
Exemplo n.º 2
0
        public void FindView_ShouldReturnJsonViewForJsonRequests()
        {
            JsonViewEngine engine = new JsonViewEngine();

            ViewEngineResult result = engine.FindView(ContextForJson(), "someViewName", "someMasterName", false);

            Assert.IsInstanceOf<ViewEngineResult>(result);
            Assert.IsInstanceOf<JsonView>(result.View);
        }
Exemplo n.º 3
0
 public void FindView_ShouldReturnNullForNonJsonRequests()
 {
     JsonViewEngine engine = new JsonViewEngine();
     Assert.Null(engine.FindView(ContextByContentType("text/html"), "someViewName", "someMasterName", false));
 }