Пример #1
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);
        }
Пример #2
0
        public void Contact()
        {
            // Arrange
            HomeController controller = new HomeController();

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

            // Assert
            Assert.IsNotNull(result);
        }
Пример #3
0
 public void ToIntTest()
 {
     HomeController target = new HomeController();
     string value = "5";
     int expected = 5;//预期的值
     int actual;//实际的值
     actual = target.ToInt(value);
     Assert.AreEqual(expected, actual);
     value = "5.5";
     expected = 5;
     actual = target.ToInt(value);
     Assert.AreEqual(expected, actual);
 }