Esempio n. 1
0
        public void testUpdatePlan()
        {
            updatePlan updatePlan = new updatePlan();

            updatePlan.planCode = "theCode";

            var mock = new Mock <Communications>();

            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>");

            Communications mockedCommunication = mock.Object;

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

            Assert.AreEqual("theCode", updatePlanResponse.planCode);
        }