예제 #1
0
        public void GetNotificationTemplate_NullConnectionServer_Failure()
        {
            List <NotificationTemplate> oDevices;

            WebCallResult res = NotificationTemplate.GetNotificationTemplates(null, out oDevices);

            Assert.IsFalse(res.Success, "Null Connection server object should fail");
        }
예제 #2
0
        public void NotificationTemplate_Test()
        {
            _errorString = "";
            List <NotificationTemplate> oNotificationTemplates;
            var res = NotificationTemplate.GetNotificationTemplates(_connectionServer, out oNotificationTemplates, 1, 2);

            Assert.IsTrue(res.Success, "Failed to fetch notificationtemplate:" + res);
            Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString);
        }
예제 #3
0
        public void GetNotificationTemplates_Success()
        {
            List <NotificationTemplate> oDevices;

            WebCallResult res = NotificationTemplate.GetNotificationTemplates(_connectionServer, out oDevices);

            Assert.IsTrue(res.Success, "Failed to fetch HTTP notification devices from server");
            Assert.IsTrue(oDevices.Count > 0, "No HTTP notification templates found on server");

            //exercise tostring and dumpallprops
            Console.WriteLine(oDevices[0].ToString());
            Console.WriteLine(oDevices[0].DumpAllProps());
        }
예제 #4
0
        public void NotificationTemplate_ConstructorWithObjectId_Success()
        {
            List <NotificationTemplate> oDevices;

            WebCallResult res = NotificationTemplate.GetNotificationTemplates(_connectionServer, out oDevices);

            Assert.IsTrue(res.Success, "Failed to fetch HTTP notification devices from server");
            Assert.IsTrue(oDevices.Count > 0, "No HTTP notification templates found on server");

            try
            {
                NotificationTemplate oNewTemplate = new NotificationTemplate(_connectionServer, oDevices[0].NotificationTemplateId);
                Console.WriteLine(oNewTemplate);
            }
            catch (Exception ex)
            {
                Assert.Fail("Failed to create new NotificationTemplate instance off NEW keyword with valid ObjectId:" + ex);
            }
        }
예제 #5
0
        public void NotificationDevice_AddHtmlDevice()
        {
            List <NotificationTemplate> oHtmlTemplates;
            var res = NotificationTemplate.GetNotificationTemplates(_connectionServer, out oHtmlTemplates, 1, 1);

            Assert.IsTrue(res.Success, "Failed to fetch notification templates:" + res);
            Assert.IsTrue(oHtmlTemplates.Count > 0, "No HTML templates found");

            string strDisplayName = Guid.NewGuid().ToString();

            res = NotificationDevice.AddHtmlDevice(_connectionServer, _tempUser.ObjectId,
                                                   oHtmlTemplates[0].NotificationTemplateId,
                                                   strDisplayName, "*****@*****.**", "NewVoiceMail", true);
            Assert.IsTrue(res.Success, "Failed to create new HTML notification device:" + res);

            NotificationDevice oDevice;

            res = NotificationDevice.GetNotificationDevice(_connectionServer, _tempUser.ObjectId, "", strDisplayName, out oDevice);
            Assert.IsTrue(res.Success, "Failed to fetch newly created HTML notification device:" + res);

            res = oDevice.Delete();
            Assert.IsTrue(res.Success, "Failed to delete new HTML notification device:" + res);
        }