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