public void SendTest_UnlinkedCredit_InvalidExpirationDate() { //check login / password string sError = CheckLoginPassword(); Assert.IsTrue(sError == "", sError); string responseString = "3|1|7|Credit card expiration date is invalid.||P|0||UnlinkedCredit transaction approved testing|20.15|CC|credit||||||||||||||||||||||||||76688C1759F2A7C3616A595012F99289|||||||||||||XXXX1111|Visa||||||||||||||||"; LocalRequestObject.ResponseString = responseString; IGatewayResponse expected = new GatewayResponse(responseString.Split('|')); Gateway target = new Gateway(ApiLogin, TransactionKey, true); IGatewayRequest request = new UnlinkedCredit((decimal)20.15, "4111111111111111", "24"); request.DuplicateWindow = "0"; string description = "UnlinkedCredit transaction InvalidExpirationDate testing"; IGatewayResponse actual = target.Send(request, description); Assert.AreEqual(expected.Amount, actual.Amount); Assert.AreEqual(expected.Approved, actual.Approved); Assert.AreEqual(expected.CardNumber, actual.CardNumber); Assert.AreEqual(expected.Message, actual.Message); Assert.AreEqual(expected.ResponseCode, actual.ResponseCode); Assert.IsTrue(actual.TransactionID.Trim().Length > 0); Assert.IsTrue(long.Parse(actual.TransactionID) == 0); }
public void SendTest_UnlinkedCredit_Approved() { //check login / password string sError = CheckLoginPassword(); Assert.IsTrue(sError == "", sError); string responseString = "1|1|1|This transaction has been approved.||P|2207179642||UnlinkedCredit transaction approved testing|20.15|CC|credit||||||||||||||||||||||||||1F01159A9561E77E4AD004FF64069B05|||||||||||||XXXX1111|Visa||||||||||||||||"; LocalRequestObject.ResponseString = responseString; IGatewayResponse expected = new GatewayResponse(responseString.Split('|')); Gateway target = new Gateway(ApiLogin, TransactionKey, true); IGatewayRequest request = new UnlinkedCredit((decimal)20.15, "4111111111111111", "0224"); request.DuplicateWindow = "0"; string description = "UnlinkedCredit transaction approved testing"; IGatewayResponse actual = target.Send(request, description); Assert.AreEqual(expected.Amount, actual.Amount); Assert.AreEqual(expected.Approved, actual.Approved); Assert.AreEqual(expected.CardNumber, actual.CardNumber); Assert.AreEqual(expected.Message, actual.Message); Assert.AreEqual(expected.ResponseCode, actual.ResponseCode); Assert.IsTrue(actual.TransactionID.Trim().Length > 0); Assert.IsTrue(long.Parse(actual.TransactionID) > 0); }