public void ShouldFailIfTxDoesNotExist()
        {
            // Arrange
            AuthoriseIpnHandler handler = new AuthoriseIpnHandler(m_repository);
            m_request.Object.Form["txn_id"] = "plibble";

            // Act
            ContentResult result = handler.Process(m_request.Object, m_modelState) as ContentResult;

            // Assert
            Assert.IsTrue(result.Content.StartsWith("INVALID"));
        }
        public void ShouldReturnVerified()
        {
            // Arrange
            AuthoriseIpnHandler handler = new AuthoriseIpnHandler(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("VERIFIED"));
        }
        public void ShouldFailIfBindingError()
        {
            // Arrange
            AuthoriseIpnHandler handler = new AuthoriseIpnHandler(m_repository);
            m_request.Object.Form.Remove("txn_id");

            // 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("INVALID"));
        }