Inheritance: Controller
コード例 #1
0
		public void HomeContact()
		{
			// Arrange
			HomeController controller = new HomeController(catalogService.Object);

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

			// Assert
			Assert.IsNotNull(result);
		}
コード例 #2
0
		public async Task HomeIndex()
		{
			// Arrange
			HomeController controller = new HomeController(catalogService.Object);

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

			// Assert
			Assert.IsNotNull(result);
			HomeViewModel model = result.Model as HomeViewModel;
			Assert.IsNotNull(model);
			Assert.AreEqual(3, model.Deals.Count);
		}