Exemplo n.º 1
0
 public void TestIndexCreatesANewBoard()
 {
     var controller = new HomeController();
     var controllerContext = new ControllerContextMock(controller);
     controllerContext.Session.SetupGet(s => s["Board"]).Returns(null);
     var result = controller.Index() as ViewResult;
     Assert.IsNotNull(result.ViewData["Board"]);
     Assert.AreEqual(typeof(Board), result.ViewData["Board"].GetType());
 }
Exemplo n.º 2
0
 public void TestIndexUsesAnExistingBoard()
 {
     var board = new Board();
     var controller = new HomeController();
     var controllerContext = new ControllerContextMock(controller);
     controllerContext.Session.SetupGet(s => s["Board"]).Returns(board);
     var result = controller.Index() as ViewResult;
     Assert.IsNotNull(result.ViewData["Board"]);
     Assert.AreEqual(board, result.ViewData["Board"]);
 }