Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Web.Mvc;
|
---|
6 | using Microsoft.VisualStudio.TestTools.UnitTesting;
|
---|
7 | using HLWebHelloWorldPlugin;
|
---|
8 | using HLWebHelloWorldPlugin.Controllers;
|
---|
9 |
|
---|
10 | namespace 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.