예제 #1
0
        public void AddPort_ErrorResponse_Failure()
        {
            BaseUnitTests.Reset();
            _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.GET, It.IsAny <ConnectionServerRest>(),
                                                        It.IsAny <string>(), true)).Returns(new WebCallResult
            {
                Success      = false,
                ResponseText = "error text",
                StatusCode   = 404
            });

            var res = Port.AddPort(_mockServer, "ObjectId", 2, null);

            Assert.IsFalse(res.Success, "Calling AddPort with ErrorResponse did not fail");
        }
예제 #2
0
        public void PhoneSystem_TopLevelUpdates()
        {
            ConnectionPropertyList oProps = new ConnectionPropertyList();

            oProps.Add("CapMwi", true);
            WebCallResult res = Port.AddPort(_connectionServer, _portGroup.ObjectId, 2, oProps);

            Assert.IsTrue(res.Success, "Failed to create ports for port group:" + res);

            res = _phoneSystem.Update();
            Assert.IsFalse(res.Success, "Update of PhoneSystem with no pending changes did not fail:" + res);

            _phoneSystem.DisplayName = "Updated_" + Guid.NewGuid();
            _phoneSystem.RestrictDialUnconditional = true;
            res = _phoneSystem.Update();
            Assert.IsTrue(res.Success, "Failed to update phone system:" + res);
        }
예제 #3
0
        public void AddPort_InvalidPortGroupObjectId_Failure()
        {
            var res = Port.AddPort(_connectionServer, "portgroupid", 4, null);

            Assert.IsFalse(res.Success, "Static call to AddPort did not fail with invalid prop group objectId");
        }
예제 #4
0
        public void AddPort_EmptyObjectId_Failure()
        {
            var res = Port.AddPort(_mockServer, "", 4, null);

            Assert.IsFalse(res.Success, "Static call to AddPort did not fail with empty port group objectId");
        }
예제 #5
0
        public void AddPort_NullConnectionServer_Failure()
        {
            var res = Port.AddPort(null, "portgroupid", 4, null);

            Assert.IsFalse(res.Success, "Static call to AddPort did not fail with null connection server");
        }