public void ShouldDisplayBuyNow() { // Arrange BuyNowController controller = new BuyNowController(m_repository, m_httpRequest.Object); // Act ViewResult result = controller.BuyNow(1); // Assert Assert.AreEqual("", result.ViewName); Assert.IsTrue(result.ViewData.Model is PaymentViewData); Assert.AreNotEqual(null, ((PaymentViewData)result.ViewData.Model).Tx); }
public void ShouldThrowFromPaidIfInvalidId() { // Arrange BuyNowController controller = new BuyNowController(m_repository, m_httpRequest.Object); // Act try { controller.BuyNow(99); } catch (ErrorDataException) { return; } // Assert Assert.Fail("Should Throw"); }