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);
        }
Esempio 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);
        }
Esempio n. 5
0
 public void ReturnTheAboutView()
 {
     var homeController = new HomeController();
      ViewResult viewResult = (ViewResult)homeController.About();
      Assert.AreEqual("About", viewResult.ViewName);
 }
 public void SetUp()
 {
     homeController = new HomeController();
 }
Esempio n. 7
0
        public void Setup()
        {
            _mockIndexModelRepository = new Mock<IIndexModelRepository>();

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