public void ShouldReturnFailIfCannotFindTxInDatabase() { // Arrange AuthorisePdtHandler handler = new AuthorisePdtHandler(m_repository); m_request.Object.Form["tx"] = "plibble"; // Act ContentResult result = handler.Process(m_request.Object, m_modelState) as ContentResult; // Assert Assert.AreNotEqual(null, result); Assert.AreEqual(Encoding.UTF8, result.ContentEncoding); Assert.AreEqual("text/html", result.ContentType); Assert.IsTrue(result.Content.StartsWith("FAIL")); }
public void ShouldReturnSuccess() { // Arrange AuthorisePdtHandler handler = new AuthorisePdtHandler(m_repository); // Act ContentResult result = handler.Process(m_request.Object, m_modelState) as ContentResult; // Assert Assert.AreNotEqual(null, result); Assert.AreEqual(Encoding.UTF8, result.ContentEncoding); Assert.AreEqual("text/html", result.ContentType); Assert.IsTrue(result.Content.StartsWith("SUCCESS")); }