Esempio n. 1
0
        public void AddPortGroup_EmptyPhoneSystemId_Failure()
        {
            var res = PortGroup.AddPortGroup(_mockServer, "Display Name", "", "HostAddress",
                                             TelephonyIntegrationMethodEnum.SCCP, "sccpPrefix");

            Assert.IsFalse(res.Success, "Calling UpdatePortGroup with empty phone system ID should fail.");
        }
Esempio n. 2
0
        public void AddPortGroup_NullConnectionServer_Failure()
        {
            var res = PortGroup.AddPortGroup(null, "Display Name", "PhoneSystemId", "HostAddress",
                                             TelephonyIntegrationMethodEnum.SCCP, "sccpPrefix");

            Assert.IsFalse(res.Success, "Calling UpdatePortGroup with null ConnectionServer should fail.");
        }
Esempio n. 3
0
        public void AddPortGroup_EmptyHostAddress_Failure()
        {
            PortGroup oPortGroup;
            var       res = PortGroup.AddPortGroup(_mockServer, "Display Name", "PhoneSystemId", "",
                                                   TelephonyIntegrationMethodEnum.SCCP, "sccpPrefix", out oPortGroup);

            Assert.IsFalse(res.Success, "Calling UpdatePortGroup with empty host address should fail.");
        }
Esempio n. 4
0
        public new static void MyClassInitialize(TestContext testContext)
        {
            BaseIntegrationTests.MyClassInitialize(testContext);

            WebCallResult res = PhoneSystem.AddPhoneSystem(_connectionServer, "UnitTest_" + Guid.NewGuid(), out _phoneSystem);

            Assert.IsTrue(res.Success, "Creating new temporary phone system failed:" + res);

            res = PortGroup.AddPortGroup(_connectionServer, "UnitTest_" + Guid.NewGuid(), _phoneSystem.ObjectId,
                                         _connectionServer.ServerName, TelephonyIntegrationMethodEnum.SIP, "", out _portGroup);
            Assert.IsTrue(res.Success, "Creating new temporary port group failed:" + res);
        }
Esempio n. 5
0
        public void AddPortGroup_ErrorResponse_Failure()
        {
            Reset();
            //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>(), MethodType.GET, It.IsAny <ConnectionServerRest>(),
                                                        It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult
            {
                Success          = true,
                ResponseText     = "dummy text",
                TotalObjectCount = 1
            });

            //error response for post
            _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.POST, It.IsAny <ConnectionServerRest>(),
                                                        It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult
            {
                Success      = false,
                ResponseText = "error text",
                StatusCode   = 404
            });

            var res = PortGroup.AddPortGroup(_mockServer, "display name", "PhoneSysteId", "HostAddress", TelephonyIntegrationMethodEnum.PIMG);

            Assert.IsFalse(res.Success, "Calling AddPortGroup with ErrorResponse did not fail");
        }