Inheritance: recurringTransactionType
Beispiel #1
0
        public updatePlanResponse UpdatePlan(updatePlan updatePlan)
        {
            litleOnlineRequest request = createLitleOnlineRequest();

            request.updatePlan = updatePlan;

            litleOnlineResponse response           = sendToLitle(request);
            updatePlanResponse  updatePlanResponse = response.updatePlanResponse;

            return(updatePlanResponse);
        }
Beispiel #2
0
        public void TestUpdatePlan()
        {
            var updatePlan = new updatePlan();

            batchRequest.addUpdatePlan(updatePlan);

            Assert.AreEqual(1, batchRequest.getNumUpdatePlans());

            mockCnpFile.Verify(cnpFile => cnpFile.createRandomFile(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), mockCnpTime.Object));
            mockCnpFile.Verify(cnpFile => cnpFile.AppendLineToFile(mockFilePath, updatePlan.Serialize()));
        }
Beispiel #3
0
        public void testUpdatePlan()
        {
            updatePlan updatePlan = new updatePlan();

            batchRequest.addUpdatePlan(updatePlan);

            Assert.AreEqual(1, batchRequest.getNumUpdatePlans());

            mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny <String>(), It.IsAny <String>(), It.IsAny <String>(), mockLitleTime.Object));
            mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, updatePlan.Serialize()));
        }
Beispiel #4
0
 public void addUpdatePlan(updatePlan updatePlan)
 {
     if (numAccountUpdates == 0)
     {
         numUpdatePlans++;
         tempBatchFilePath = saveElement(litleFile, litleTime, tempBatchFilePath, updatePlan);
     }
     else
     {
         throw new LitleOnlineException(accountUpdateErrorMessage);
     }
 }
        public void TestUpdatePlan_Full()
        {
            updatePlan update = new updatePlan();

            update.planCode = "abc";
            update.active   = true;

            String actual   = update.Serialize();
            String expected = @"
<updatePlan>
<planCode>abc</planCode>
<active>true</active>
</updatePlan>";

            Assert.AreEqual(Regex.Replace(expected, @"\s+", String.Empty), Regex.Replace(actual, @"\s+", String.Empty));
        }
Beispiel #6
0
        public void TestUpdatePlan_Full()
        {
            updatePlan update = new updatePlan();

            update.planCode = "abc";
            update.active   = true;

            String actual   = update.Serialize();
            String expected = @"
<updatePlan>
<planCode>abc</planCode>
<active>true</active>
</updatePlan>";

            Assert.AreEqual(expected, actual);
        }
Beispiel #7
0
        public void TestUpdatePlan()
        {
            updatePlan updatePlan = new updatePlan();

            updatePlan.planCode = "theCode";

            var mock = new Mock <Communications>();

            mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*?<cnpOnlineRequest.*?<updatePlan.*?<planCode>theCode</planCode>.*?</updatePlan>.*?", RegexOptions.Singleline), It.IsAny <Dictionary <String, String> >()))
            .Returns("<cnpOnlineResponse version='8.21' response='0' message='Valid Format' xmlns='http://www.vantivcnp.com/schema'><updatePlanResponse><planCode>theCode</planCode></updatePlanResponse></cnpOnlineResponse>");

            Communications mockedCommunication = mock.Object;

            cnp.SetCommunication(mockedCommunication);
            updatePlanResponse updatePlanResponse = cnp.UpdatePlan(updatePlan);

            Assert.AreEqual("theCode", updatePlanResponse.planCode);
        }
        public void testUpdatePlan()
        {
            var updatePlan = new updatePlan();

            updatePlan.planCode = "theCode";

            var mock = new Mock <Communications>(_memoryStreams);

            mock.Setup(
                Communications =>
                Communications.HttpPost(
                    It.IsRegex(
                        ".*?<litleOnlineRequest.*?<updatePlan.*?<planCode>theCode</planCode>.*?</updatePlan>.*?",
                        RegexOptions.Singleline), It.IsAny <Dictionary <string, string> >()))
            .Returns(
                "<litleOnlineResponse version='8.21' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><updatePlanResponse><planCode>theCode</planCode></updatePlanResponse></litleOnlineResponse>");

            var mockedCommunication = mock.Object;

            litle.setCommunication(mockedCommunication);
            var updatePlanResponse = litle.UpdatePlan(updatePlan);

            Assert.AreEqual("theCode", updatePlanResponse.planCode);
        }
 public void addUpdatePlan(updatePlan updatePlan)
 {
     if (numAccountUpdates == 0)
     {
         numUpdatePlans++;
         tempBatchFilePath = saveElement(litleFile, litleTime, tempBatchFilePath, updatePlan);
     }
     else
     {
         throw new LitleOnlineException(accountUpdateErrorMessage);
     }
 }
        public void testUpdatePlan()
        {
            updatePlan updatePlan = new updatePlan();
            updatePlan.planCode = "thePlanCode";
            updatePlan.active = true;

            var mockLitleResponse = new Mock<litleResponse>();
            var mockLitleXmlSerializer = new Mock<litleXmlSerializer>();

            mockXmlReader.SetupSequence(XmlReader => XmlReader.ReadOuterXml())
                .Returns("<updatePlanResponse xmlns=\"http://www.litle.com/schema\"><litleTxnId>123</litleTxnId></updatePlanResponse>")
                .Returns("<updatePlanResponse xmlns=\"http://www.litle.com/schema\"><litleTxnId>124</litleTxnId></updatePlanResponse>");

            batchResponse mockLitleBatchResponse = new batchResponse();
            mockLitleBatchResponse.setUpdatePlanResponseReader(mockXmlReader.Object);

            mockLitleResponse.Setup(litleResponse => litleResponse.nextBatchResponse()).Returns(mockLitleBatchResponse);
            litleResponse mockedLitleResponse = mockLitleResponse.Object;

            mockLitleXmlSerializer.Setup(litleXmlSerializer => litleXmlSerializer.DeserializeObjectFromFile(It.IsAny<String>())).Returns(mockedLitleResponse);

            Communications mockedCommunication = mockCommunications.Object;
            litle.setCommunication(mockedCommunication);

            litleXmlSerializer mockedLitleXmlSerializer = mockLitleXmlSerializer.Object;
            litle.setLitleXmlSerializer(mockedLitleXmlSerializer);

            litleFile mockedLitleFile = mockLitleFile.Object;
            litle.setLitleFile(mockedLitleFile);

            litle.setLitleTime(mockLitleTime.Object);

            batchRequest litleBatchRequest = new batchRequest();
            litleBatchRequest.setLitleFile(mockedLitleFile);
            litleBatchRequest.setLitleTime(mockLitleTime.Object);
            litleBatchRequest.addUpdatePlan(updatePlan);
            litleBatchRequest.addUpdatePlan(updatePlan);
            litle.addBatch(litleBatchRequest);

            string batchFileName = litle.sendToLitle();
            litleResponse actualLitleResponse = litle.receiveFromLitle(batchFileName);
            batchResponse actualLitleBatchResponse = actualLitleResponse.nextBatchResponse();

            Assert.AreSame(mockLitleBatchResponse, actualLitleBatchResponse);
            Assert.AreEqual("123", actualLitleBatchResponse.nextUpdatePlanResponse().litleTxnId);
            Assert.AreEqual("124", actualLitleBatchResponse.nextUpdatePlanResponse().litleTxnId);
            Assert.IsNull(actualLitleBatchResponse.nextUpdatePlanResponse());

            mockCommunications.Verify(Communications => Communications.FtpDropOff(It.IsAny<String>(), mockFileName, It.IsAny<Dictionary<String, String>>()));
            mockCommunications.Verify(Communications => Communications.FtpPickUp(It.IsAny<String>(), It.IsAny<Dictionary<String, String>>(), mockFileName));
        }
Beispiel #11
0
 public updatePlanResponse UpdatePlan(updatePlan transaction)
 {
     return(this.SendTransaction <updatePlanResponse>(transaction));
 }
        public void TestUpdatePlan_Full()
        {
            updatePlan update = new updatePlan();
            update.planCode = "abc";
            update.active = true;

            String actual = update.Serialize();
            String expected = @"
            <updatePlan>
            <planCode>abc</planCode>
            <active>true</active>
            </updatePlan>";
            Assert.AreEqual(expected, actual);
        }
        public updatePlanResponse UpdatePlan(updatePlan updatePlan)
        {
            litleOnlineRequest request = createLitleOnlineRequest();
            request.updatePlan = updatePlan;

            litleOnlineResponse response = sendToLitle(request);
            updatePlanResponse updatePlanResponse = response.updatePlanResponse;
            return updatePlanResponse;
        }
Beispiel #14
0
 public updatePlanResponse UpdatePlan(updatePlan updatePlan)
 {
     return(SendRequest(response => response.updatePlanResponse, updatePlan));
 }
        public void testUpdatePlan()
        {
            var updatePlan = new updatePlan();
            updatePlan.planCode = "theCode";

            var mock = new Mock<Communications>(_memoryStreams);

            mock.Setup(
                Communications =>
                    Communications.HttpPost(
                        It.IsRegex(
                            ".*?<litleOnlineRequest.*?<updatePlan.*?<planCode>theCode</planCode>.*?</updatePlan>.*?",
                            RegexOptions.Singleline), It.IsAny<Dictionary<string, string>>()))
                .Returns(
                    "<litleOnlineResponse version='8.21' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><updatePlanResponse><planCode>theCode</planCode></updatePlanResponse></litleOnlineResponse>");

            var mockedCommunication = mock.Object;
            litle.setCommunication(mockedCommunication);
            var updatePlanResponse = litle.UpdatePlan(updatePlan);
            Assert.AreEqual("theCode", updatePlanResponse.planCode);
        }
        public void testUpdatePlan()
        {
            updatePlan updatePlan = new updatePlan();

            batchRequest.addUpdatePlan(updatePlan);

            Assert.AreEqual(1, batchRequest.getNumUpdatePlans());

            mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<String>(), mockLitleTime.Object));
            mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, updatePlan.Serialize()));
        }