public void ShowsCorrectIndexView() { var cc = new CalcController(); var result = cc.Index() as ViewResult; Assert.Equal("Index", result.ViewName); }
public void TestInit() { context = new Mock <ControllerContext>(); //context = MockRepository.GenerateMock<ControllerContext>(); controller = new CalcController(); controller.ControllerContext = context.Object; model = new CalcModel(); var statemanager = new Mock <SessionStateManager <CalcModel> >(); statemanager.Setup(l => l.load("model")).Returns(model); statemanager.Setup(s => s.save("model", model)); controller.setStateManager(statemanager.Object); controller.Index(); }
public void TestSimpleInput1() { controller.Index("1"); //CalcModel test = (CalcModel)session["model"]; Assert.AreEqual("1", model.Display); }