示例#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);
        }
示例#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);
        }
示例#3
0
 public void FindView_ShouldReturnNullForNonJsonRequests()
 {
     JsonViewEngine engine = new JsonViewEngine();
     Assert.Null(engine.FindView(ContextByContentType("text/html"), "someViewName", "someMasterName", false));
 }