예제 #1
0
        public void GetPortGroupTemplateObjectId_Success()
        {
            //setup so the fetch for port group templates returns a match on the integration method we're using (PIMG)
            PortGroupTemplate oTemplate = new PortGroupTemplate();

            oTemplate.CopyTelephonyIntegrationMethodEnum = TelephonyIntegrationMethodEnum.PIMG;
            List <PortGroupTemplate> oList = new List <PortGroupTemplate>();

            oList.Add(oTemplate);

            _mockTransport.Setup(x => x.GetObjectsFromJson <PortGroupTemplate>(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(oList);

            //make sure all "gets" return true.
            _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), It.IsAny <MethodType>(), It.IsAny <ConnectionServerRest>(),
                                                        It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult
            {
                Success          = true,
                ResponseText     = "dummy text long enough to be considered legitimate JSON body",
                TotalObjectCount = 1
            });

            string strObjectId;
            var    res = PortGroupTemplate.GetPortGroupTemplateObjectId(_mockServer, TelephonyIntegrationMethodEnum.PIMG, out strObjectId);

            Assert.IsTrue(res.Success, "Fetching port group template for integration method failed:" + res);
        }
        public void GetPortGroupTemplateObjectId_Sip_Success()
        {
            string strObjectId;
            var    res = PortGroupTemplate.GetPortGroupTemplateObjectId(_connectionServer, TelephonyIntegrationMethodEnum.SIP, out strObjectId);

            Assert.IsTrue(res.Success, "Static call to GetPortGroupTemplateObjectId for SIP failed:" + res);
        }
예제 #3
0
        public void GetPortGroupTemplateObjectId_NullConnectionServer_Failure()
        {
            string strObjectId;
            var    res = PortGroupTemplate.GetPortGroupTemplateObjectId(null, TelephonyIntegrationMethodEnum.SCCP, out strObjectId);

            Assert.IsFalse(res.Success, "Static call to GetPortGroupTemplateObjectId did not fail with: null ConnectionServer");
        }