public void About()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            ViewResult result = controller.About() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
        public void Index()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.AreEqual("Welcome to ASP.NET MVC!", result.ViewBag.Message);
        }
Exemplo n.º 3
0
        public void Index()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.AreEqual("Modify this template to jump-start your ASP.NET MVC application.", result.ViewBag.Message);
        }
        public void ShouldAllowForAGameSetupThatCreatesLocations()
        {
            var controller = new HomeController();

            ViewResult result = (ViewResult)controller.CreateGame();

            Assert.IsNotNull(result.Model);
            var typedModel = result.Model as GameModel;
            Assert.IsNotNull(typedModel.Players);
            Assert.IsNotNull(typedModel.Locations);
        }
Exemplo n.º 5
0
 public void ReturnTheAboutView()
 {
     var homeController = new HomeController();
      ViewResult viewResult = (ViewResult)homeController.About();
      Assert.AreEqual("About", viewResult.ViewName);
 }
Exemplo n.º 6
0
 public void SetUp()
 {
     homeController = new HomeController();
 }
Exemplo n.º 7
0
        public void Setup()
        {
            _mockIndexModelRepository = new Mock<IIndexModelRepository>();

            _homeController = new HomeController(
                _mockIndexModelRepository.Object);
        }
Exemplo n.º 8
0
 public void ReturnTheIndexView()
 {
     var homeController = new HomeController();
      ViewResult viewResult = (ViewResult)homeController.Index();
      Assert.AreEqual("Index", viewResult.ViewName);
 }