public void GCDPost_CorrectString_ReturnsPartialViewWithFlagTrueAndResultFromImplementations() { var basicAlgorithmsMock = new Mock<BasicAlgorithms>(); basicAlgorithmsMock.Setup(m => m.GCD(10, 312)).Returns(2); var controller = new BasicAlgorithmsController(basicAlgorithmsMock.Object); var partialView = controller.GCD("10", "312"); Assert.AreEqual(true, ((ResultsViewModel)partialView.Model).Success); Assert.AreEqual("2", ((ResultsViewModel)partialView.Model).Result); }
public void GCDPost_IncorrectString_ReturnsPartialViewWithFlagFalse() { var controller = new BasicAlgorithmsController(); var partialView = controller.GCD("10a", "x"); Assert.AreEqual(false, ((ResultsViewModel)partialView.Model).Success); }