Esempio n. 1
0
        public void AddPortGroupCodec_NullConnectionServer_Failure()
        {
            PortGroupCodec oPortGroupCodec;
            WebCallResult  res = PortGroupCodec.AddPortGroupCodec(null, "portgroupid", "rtpobjectid", 20, 1, out oPortGroupCodec);

            Assert.IsFalse(res.Success, "Static call to AddPortGroupCodec did not fail with null connection server ");
        }
Esempio n. 2
0
        public void PhoneSystem_CodecTests()
        {
            //remove codecs
            List <PortGroupCodec> oPortGroupCodecs;
            WebCallResult         res = PortGroupCodec.GetPortGroupCodecs(_connectionServer, _portGroup.ObjectId, out oPortGroupCodecs);

            Assert.IsTrue(res.Success, "Failed to fetch port group codecs:" + res);

            foreach (var oCodec in oPortGroupCodecs)
            {
                res = oCodec.Delete();
                Assert.IsTrue(res.Success, "Failed to delete port group codec:" + res);
            }

            //add codec in
            List <RtpCodecDef> oCodecs;

            res = RtpCodecDef.GetRtpCodecDefs(_connectionServer, out oCodecs);
            Assert.IsTrue(res.Success, "Failed to fetch RtpCodec Definitions from server:" + res);
            Assert.IsTrue(oCodecs.Count > 0, "No codecs fetched from server:" + res);

            PortGroupCodec oPortGroupCodec;

            res = PortGroupCodec.AddPortGroupCodec(_connectionServer, _portGroup.ObjectId, oCodecs[0].ObjectId, 20, 1, out oPortGroupCodec);
            Assert.IsTrue(res.Success, "Failed to add RtpCode to port group:" + res);
        }
Esempio n. 3
0
        public void GetPortGroupCodecs_NullConnectionServer_Failure()
        {
            List <PortGroupCodec> oList;
            var res = PortGroupCodec.GetPortGroupCodecs(null, "portgroupobjectid", out oList);

            Assert.IsFalse(res.Success, "Static call to GetPortGroupCodecs did not fail with null connection server");
        }
Esempio n. 4
0
        public void GetPortGroupCodecs_EmptyPortGroupObjectId_Failure()
        {
            List <PortGroupCodec> oList;
            var res = PortGroupCodec.GetPortGroupCodecs(_mockServer, "", out oList);

            Assert.IsFalse(res.Success, "Static call to GetPortGroupCodecs did not fail with empty media port objectId");
        }
        public void GetPortGroupCodec_InvalidObjectId_Success()
        {
            List <PortGroupCodec> oList;

            var res = PortGroupCodec.GetPortGroupCodecs(_connectionServer, "bogus", out oList);

            Assert.IsTrue(res.Success, "Static call to GetPortGroupCodecs with invalid objectId should not fail:" + res);
            Assert.IsTrue(oList.Count == 0, "Call to GetPortGroupCodec with invalid ObjectId should return an empty list");
        }
        private PortGroupCodec HelperGetPortGroupCodec()
        {
            PortGroup oPortGroup = HelperGetPortGroup();

            List <PortGroupCodec> oPortGroupCodecs;
            var res = PortGroupCodec.GetPortGroupCodecs(_connectionServer, oPortGroup.ObjectId, out oPortGroupCodecs);

            Assert.IsTrue(res.Success, "Failed to fetch port group codecs:" + res);
            Assert.IsTrue(oPortGroupCodecs.Count > 0, "No port group codecs found in port group:" + res);
            return(oPortGroupCodecs[0]);
        }
        public void GetPortGroupCodecs_Success()
        {
            PortGroup oPortGroup = HelperGetPortGroup();

            //exercise ToString and DumpAllProps interfaces
            Console.WriteLine(oPortGroup.ToString());
            Console.WriteLine(oPortGroup.DumpAllProps());

            List <PortGroupCodec> oPortGroupCodecs;
            var res = PortGroupCodec.GetPortGroupCodecs(_connectionServer, oPortGroup.ObjectId, out oPortGroupCodecs);

            Assert.IsTrue(res.Success, "Failed to fetch port group codecs:" + res);
            Assert.IsTrue(oPortGroupCodecs.Count > 0, "No port group codecs found in port group:" + res);
        }
        public void PortGroupCodec_ConstructorWithObjectId_Success()
        {
            PortGroupCodec oPortGroupCodec = HelperGetPortGroupCodec();
            PortGroup      oPortGroup      = HelperGetPortGroup();

            //exercise ToString and DumpAllProps interfaces
            Console.WriteLine(oPortGroupCodec.ToString());
            Console.WriteLine(oPortGroupCodec.DumpAllProps());

            try
            {
                PortGroupCodec oTest = new PortGroupCodec(_connectionServer, oPortGroup.ObjectId, oPortGroupCodec.ObjectId);
                Console.WriteLine(oTest);
            }
            catch (Exception ex)
            {
                Assert.Fail("Failed to create new port group codec instance with valid objectId:" + ex);
            }
        }
Esempio n. 9
0
        public void PortGroup_Test()
        {
            _errorString = "";
            List <PortGroup> oPortGroups;
            var res = PortGroup.GetPortGroups(_connectionServer, out oPortGroups, 1, 2);

            Assert.IsTrue(res.Success & oPortGroups.Count > 0, "Failed to fetch port groups:" + res);
            Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString);

            //PortGroupCodec
            List <PortGroupCodec> oPortGroupCodecs;

            res = PortGroupCodec.GetPortGroupCodecs(_connectionServer, oPortGroups[0].ObjectId, out oPortGroupCodecs);
            Assert.IsTrue(res.Success & oPortGroupCodecs.Count > 0, "Failed to fetch port group codecs:" + res);
            Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString);

            //PortGroupServer
            List <PortGroupServer> oPortGroupServers;

            res = PortGroupServer.GetPortGroupServers(_connectionServer, oPortGroups[0].ObjectId, out oPortGroupServers);
            Assert.IsTrue(res.Success & oPortGroupServers.Count > 0, "Failed to fetch port group server:" + res);
            Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString);
        }
        public void AddPortGroupCodec_InvalidPortGroupId_Failure()
        {
            var res = PortGroupCodec.AddPortGroupCodec(_connectionServer, "portgroupid", "objectid", 20, 1);

            Assert.IsFalse(res.Success, "Static call to AddPortGroupCodec did not fail with invalid port group Id and objectid");
        }
Esempio n. 11
0
        public void AddPortGroupCodec_EmptyRtpDefObjectId_Failure()
        {
            var res = PortGroupCodec.AddPortGroupCodec(_mockServer, "portgroupid", "", 20, 1);

            Assert.IsFalse(res.Success, "Static call to AddPortGroupCodec did not fail with empty objectid");
        }
        public void DeletePortGroupCodec_InvalidPortGroupAndObjectId_Failure()
        {
            var res = PortGroupCodec.DeletePortGroupCodec(_connectionServer, "portgroupobjectid", "objectid");

            Assert.IsFalse(res.Success, "Static call to DeletePortGroupCodec did not fail with invalid port group and objectid");
        }
        public void ClassConstructor_InvalidObjectId_Failure()
        {
            PortGroupCodec oPort = new PortGroupCodec(_connectionServer, "bogus", "bogus");

            Console.WriteLine(oPort);
        }
Esempio n. 14
0
        public void Constructor_NullConnectionServer_Failure()
        {
            PortGroupCodec oPort = new PortGroupCodec(null, "PortGroupId");

            Console.WriteLine(oPort);
        }
Esempio n. 15
0
        public void Constructor_EmptyObjectId_Failure()
        {
            PortGroupCodec oPort = new PortGroupCodec(_mockServer, "");

            Console.WriteLine(oPort);
        }
Esempio n. 16
0
        public void DeletePortGroupCodec_NullConnectionServer_Failure()
        {
            var res = PortGroupCodec.DeletePortGroupCodec(null, "portgroupobjectid", "objectid");

            Assert.IsFalse(res.Success, "Static call to AddPortGroupCodec did not fail with null connection server");
        }
Esempio n. 17
0
        public void DeletePortGroupCodec_EmptyObjectId_Failure()
        {
            var res = PortGroupCodec.DeletePortGroupCodec(_mockServer, "portgroupobjectid", "");

            Assert.IsFalse(res.Success, "Static call to DeletePortGroupCodec did not fail with empty objectid");
        }