public void GetNotificationDevice_InvalidObjectId_Failure() { NotificationDevice oDevice; var res = NotificationDevice.GetNotificationDevice(_connectionServer, _tempUser.ObjectId, "aaa", "", out oDevice); Assert.IsFalse(res.Success, "Invalid objectID should fail"); }
public void GetNotificationDevice_Success() { NotificationDevice oDevice; List <NotificationDevice> oDevices; WebCallResult res = NotificationDevice.GetNotificationDevices(_connectionServer, _tempUser.ObjectId, out oDevices); Assert.IsTrue(res.Success, "Failed to fetch notification devices for operator:" + res); //fetch the single device returned as the first in the list from the last test res = NotificationDevice.GetNotificationDevice(_connectionServer, _tempUser.ObjectId, oDevices.First().ObjectId, "", out oDevice); Assert.IsTrue(res.Success, "Failed to fetch notification device for operator:" + res); }
public void NotificationDevice_FetchTests() { List <NotificationDevice> oDevices = _tempUser.NotificationDevices(true); Assert.IsNotNull(oDevices, "Failted to get devices from user"); Assert.IsNotNull(oDevices, "Null device list returned from user"); Assert.IsTrue(oDevices.Count > 0, "No devices returned from user"); Console.WriteLine(oDevices[0].ToString()); Console.WriteLine(oDevices[0].DumpAllProps()); NotificationDevice oDevice; var res = NotificationDevice.GetNotificationDevice(_connectionServer, _tempUser.ObjectId, "", oDevices[0].DisplayName, out oDevice); Assert.IsTrue(res.Success, "Failed to fetch notificaiton device by name:" + res); }
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); }