public void TestPostIndex() { int? expected = TestContext.DataRow["Expected"] as int?; AdditionViewModel model = new AdditionViewModel() { First = TestContext.DataRow["First"] as int?, Second = TestContext.DataRow["Second"] as int? }; AdditionController testSubject = new AdditionController(); ViewResult result = testSubject.Index(model) as ViewResult; Assert.IsNotNull(result.Model); Assert.IsInstanceOfType(result.Model, typeof(AdditionViewModel)); Assert.AreEqual(expected, ((AdditionViewModel)result.Model).Result); }
public void TestGetIndex() { AdditionController testSubject = new AdditionController(); ViewResult result = testSubject.Index() as ViewResult; Assert.IsNotNull(result); }