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

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

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

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

            // Assert
            Assert.IsNotNull(result);
        }
Ejemplo n.º 3
0
        public void About()
        {
            // Arrange
            HomeController controller = new HomeController();

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

            // Assert
            Assert.That(result, Is.Not.Null);
        }
Ejemplo n.º 4
0
        public void About()
        {
            // Arrange
            HomeController controller = new HomeController();

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

            // Assert
            Assert.IsInstanceOfType(result.Model, typeof(AboutModel));
        }
Ejemplo n.º 5
0
        public void Index()
        {
            // Arrange
            HomeController controller = new HomeController();

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

            // Assert
            Assert.That("Welcome to ASP.NET MVC!", Is.EqualTo(result.ViewBag.Message));
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
        public void About()
        {
            // Arrange
            HomeController controller = new HomeController();

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

            // Assert
            Assert.AreEqual("Your application description page.", result.ViewBag.Message);
        }
Ejemplo n.º 8
0
        public void Contact()
        {
            // Disponer
            HomeController controller = new HomeController();

            // Actuar
            ViewResult result = controller.Contact() as ViewResult;

            // Declarar
            Assert.IsNotNull(result);
        }
Ejemplo n.º 9
0
        public void Index()
        {
            // Disponer
            HomeController controller = new HomeController();

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

            // Declarar
            Assert.AreEqual("Modifique esta plantilla para poner en marcha su aplicación ASP.NET MVC.", result.ViewBag.Message);
        }
Ejemplo n.º 10
0
        public void Index()
        {
            // Arrange
            var db = new FakeOdeToFoodDb();
            db.AddSet(TestData.Restaurants);
            HomeController controller = new HomeController(db);
            controller.ControllerContext = new FakeControllerContext();

            // Act
            ViewResult result = controller.Index() as ViewResult;
            IEnumerable<RestaurantListViewModel> model = result.Model as IEnumerable<RestaurantListViewModel>;
            // Assert
            Assert.AreEqual(10, model.Count());
        }
Ejemplo n.º 11
0
 public void Puts_Message_In_ViewBag()
 {
     var controller = new HomeController();
     var result = controller.Index();
     Assert.IsNull(result.ViewBag.Message);
 }
Ejemplo n.º 12
0
 public void PutsMessageInViewBag()
 {
     var controller = new HomeController();
     var result = controller.Index();
     Assert.IsNotNullOrEmpty(((ViewResult) result).ViewBag.Message);
 }
Ejemplo n.º 13
0
 public void SetUp()
 {
     mockedHttpContext = GetMockControllerContext();
     mockedOdeToFoodDb = GetMockDatabase(BuildSampleRestaurants(100));
     target = new HomeController(mockedOdeToFoodDb) { ControllerContext = mockedHttpContext };
 }