public void TestAction2() { FirstController t = new FirstController(); ViewResult r = t.Action2() as ViewResult; Assert.AreEqual("xxx", r.ViewData["Name"]); }