public void ShowsCorrectIndexView()
        {
            var cc     = new CalcController();
            var result = cc.Index() as ViewResult;

            Assert.Equal("Index", result.ViewName);
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 public void TestSimpleInput1()
 {
     controller.Index("1");
     //CalcModel test = (CalcModel)session["model"];
     Assert.AreEqual("1", model.Display);
 }