Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/plugins/HLWebHelloWorldPlugin.Tests/Controllers/HomeControllerTest.cs @ 4605

Last change on this file since 4605 was 4605, checked in by dkahn, 14 years ago

#1198 Added Hello World demo plugin

File size: 1.0 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Web.Mvc;
6using Microsoft.VisualStudio.TestTools.UnitTesting;
7using HLWebHelloWorldPlugin;
8using HLWebHelloWorldPlugin.Controllers;
9
10namespace HLWebHelloWorldPlugin.Tests.Controllers {
11    [TestClass]
12    public class HomeControllerTest {
13        [TestMethod]
14        public void Index() {
15            // Arrange
16            HomeController controller = new HomeController();
17
18            // Act
19            ViewResult result = controller.Index() as ViewResult;
20
21            // Assert
22            ViewDataDictionary viewData = result.ViewData;
23            Assert.AreEqual("Welcome to ASP.NET MVC!", viewData["Message"]);
24        }
25
26        [TestMethod]
27        public void About() {
28            // Arrange
29            HomeController controller = new HomeController();
30
31            // Act
32            ViewResult result = controller.About() as ViewResult;
33
34            // Assert
35            Assert.IsNotNull(result);
36        }
37    }
38}
Note: See TracBrowser for help on using the repository browser.