public void AddSmsDevice_InvalidEventTriggerType_Failure() { var res = NotificationDevice.AddSmsDevice(_connectionServer, "objectid", "devicename", "providerID", "*****@*****.**", "*****@*****.**", "bogusevent", true); Assert.IsFalse(res.Success, "Calling AddSmsDevice with invalid event type trigger did not fail"); }
public void AddSmsDevice_EmptySender_Failure() { var res = NotificationDevice.AddSmsDevice(_mockServer, "objectid", "SMSDevice", "aaa", "*****@*****.**", "", NotificationEventTypes.NewVoiceMail.ToString(), true); Assert.IsFalse(res.Success, "Empty sender parameter should fail"); }
public void AddPagerDevice_InvalidEventTriggerType_Failure() { var res = NotificationDevice.AddPagerDevice(_connectionServer, "objectid", "devicename", "mediaswitchid", "234234", "bogusevent", true); Assert.IsFalse(res.Success, "Calling AddPagerDevice with invalid eventID did not fail"); }
public void UpdateNotificationDevice_EmptyPropertyList_Failure() { var res = NotificationDevice.UpdateNotificationDevice(_mockServer, "objectid", "aaa", NotificationDeviceTypes.Pager, null); Assert.IsFalse(res.Success, "Empty prop list should fail"); }
public void AddPagerDevice_EmptyPhoneNumber_Failure() { var res = NotificationDevice.AddPagerDevice(_mockServer, "objectid", "devicename", "mediaswitchid", "", "event", true); Assert.IsFalse(res.Success, "Calling AddPagerDevice with empty phone number did not fail"); }
public void DeleteNotificationDevice_InvalidObjectId_Failure() { var res = NotificationDevice.DeleteNotificationDevice(_connectionServer, _tempUser.ObjectId, "aaa", NotificationDeviceTypes.Sms); Assert.IsFalse(res.Success, "Invalid device objectID should fail"); }
public void NotificationDevice_AddPhoneDevice() { var res = NotificationDevice.AddPhoneDevice(_connectionServer, _tempUser.ObjectId, Guid.NewGuid().ToString(), _tempUser.MediaSwitchObjectId, "234234", "NewUrgentVoiceMail", false); Assert.IsTrue(res.Success, "Failed to create new phone notification device"); }
public void AddPagerDevice_NullConnectionServer_Failure() { var res = NotificationDevice.AddPagerDevice(null, "objectid", "devicename", "mediaswitchid", "234234", "event", true); Assert.IsFalse(res.Success, "Calling AddPagerDevice with null Connection server did not fail"); }
public void AddPagerDevice_EmptyMediaSwitchId_Failure() { var res = NotificationDevice.AddPagerDevice(_mockServer, "objectid", "devicename", "", "234234", "event", true); Assert.IsFalse(res.Success, "Calling AddPagerDevice with empty mediaswitchid did not fail"); }
public void AddPhoneDevice_InvalidEventTrigger_Failure() { var res = NotificationDevice.AddPhoneDevice(_mockServer, "objectid", "devicename", "mediaswitchid", "234234", "invalidevent", true); Assert.IsFalse(res.Success, "Calling AddPhoneDevice with invalid media even type trigger did not fail"); }
public void AddSmsDevice_EmptySenderAddress_Failure() { var res = NotificationDevice.AddSmsDevice(_mockServer, "objectid", "devicename", "providerID", "*****@*****.**", "", "eventtype", true); Assert.IsFalse(res.Success, "Calling AddSmsDevice with empty senderaddress did not fail"); }
public async Task <bool> AddDeviceAsync(NotificationDevice device, CancellationToken cancel) { if (device == null) { return(false); } var devices = await GetDevicesAsync(cancel); await _Sync.WaitAsync(cancel); try{ var match = devices.FirstOrDefault(d => d.Id == device.Id); if (match == null) { devices.Add(device); } else if (match.AreSame(device)) { return(false); } else { devices[devices.IndexOf(match)] = device; } await SaveDevicesAsync(); return(true); }finally{ _Sync.Release(); } }
public void AddHtmlDevice_InvalidEventTriggerType_Failure() { var res = NotificationDevice.AddHtmlDevice(_connectionServer, "objectid", "templateid", "device name", "*****@*****.**", "bogusevent", false); Assert.IsFalse(res.Success, "Calling AddHtmlDevice with bogus device trigger type did not fail"); }
public void NotificationDevice_AddSmtpDevice() { var res = NotificationDevice.AddSmtpDevice(_connectionServer, _tempUser.ObjectId, Guid.NewGuid().ToString(), "*****@*****.**", "AllMessage", true); Assert.IsTrue(res.Success, "Failed to create new SMTP device:" + res); }
public void GetNotificationDevices_EmptyUserObjectId_Failure() { List <NotificationDevice> oDevices; var res = NotificationDevice.GetNotificationDevices(_mockServer, "", out oDevices); Assert.IsFalse(res.Success, "Empty UserObjectID should fail."); }
public Task <bool> AddDeviceAsync( NotificationDevice device, [FromQuery] string clientToken, CancellationToken cancel) { _Config.VerifyClientToken(clientToken); return(_Mgr.AddDeviceAsync(device, cancel)); }
public bool AreSame(NotificationDevice device) { if (device == null) { return(false); } return(Id == device.Id && Type == device.Type); }
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 AddSmsDevice_InvalidSmppProvider_Failure() { var res = NotificationDevice.AddSmsDevice(_connectionServer, _tempUser.ObjectId, "SMSDevice", "aaa", "*****@*****.**", "*****@*****.**", NotificationEventTypes.NewVoiceMail.ToString(), true); Assert.IsFalse(res.Success, "Invalid SMPP provider Id should fail"); }
public void GetNotificationDevices_NullConnectionServer_Failure() { List <NotificationDevice> oDevices; //get Notification Device list failure points. WebCallResult res = NotificationDevice.GetNotificationDevices(null, "objectid", out oDevices); Assert.IsFalse(res.Success, "Null Connection server object should fail"); }
public void GetNotificationDevices_Success() { List <NotificationDevice> oDevices; //get the notificaiton devices for the operator WebCallResult res = NotificationDevice.GetNotificationDevices(_connectionServer, _tempUser.ObjectId, out oDevices); Assert.IsTrue(res.Success, "Failed to fetch notification devices for operator:" + res); }
public void AddSmsDevice_NullConnectionServer_Failure() { //since we can't add an SMS device without a provider (which we can't dummy up) just hit the failure routes here and call //it good. WebCallResult res = NotificationDevice.AddSmsDevice(null, "objectid", "SMSDevice", "aaa", "*****@*****.**", "*****@*****.**", NotificationEventTypes.NewVoiceMail.ToString(), true); Assert.IsFalse(res.Success, "Null Connection server param should fail"); }
public void NotificationDevice_Test() { _errorString = ""; List <NotificationDevice> oNotificationDevices; var res = NotificationDevice.GetNotificationDevices(_connectionServer, _tempUser.ObjectId, out oNotificationDevices); Assert.IsTrue(res.Success, "Failed to fetch notificationdevice:" + res); Assert.IsTrue(string.IsNullOrEmpty(_errorString), _errorString); }
public void UpdateNotificationDevice_NullConnectionServer_Failure() { ConnectionPropertyList oProps = new ConnectionPropertyList(); oProps.Add("item", "value"); WebCallResult res = NotificationDevice.UpdateNotificationDevice(null, "objectid", "aaa", NotificationDeviceTypes.Pager, oProps); Assert.IsFalse(res.Success, "Null Connection Server object should fail"); }
public void GetNotificationDevices_InvalidObjectId_Success() { List <NotificationDevice> oDevices; var res = NotificationDevice.GetNotificationDevices(_connectionServer, "aaa", out oDevices); Assert.IsTrue(res.Success, "Fetching notification devices with invalid name should not fail."); Assert.IsFalse(oDevices == null, "Invalid UserObjectID fetch returned null devices list."); Assert.IsTrue(oDevices.Count == 0, "Invalid UserObjectID fetch returned one or more devices."); }
public void UpdateNotificationDevice_EmptyDeviceObjectId_Failure() { ConnectionPropertyList oProps = new ConnectionPropertyList(); oProps.Add("item", "value"); var res = NotificationDevice.UpdateNotificationDevice(_mockServer, "objectid", "", NotificationDeviceTypes.Pager, oProps); Assert.IsFalse(res.Success, "Empty device objectID should fail"); }
public void UpdateNotificationDevice_InvalidObjectId_Failure() { //failure paths for update calls ConnectionPropertyList oProps = new ConnectionPropertyList(); oProps.Add("item", "value"); var res = NotificationDevice.UpdateNotificationDevice(_connectionServer, _tempUser.ObjectId, "aaa", NotificationDeviceTypes.Pager, oProps); Assert.IsFalse(res.Success, "Invalid device 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_AddSmsDevice() { List <SmppProvider> oProviders; var res = SmppProvider.GetSmppProviders(_connectionServer, out oProviders); Assert.IsTrue(res.Success, "Failed fetching SMPP providers:" + res); Assert.IsTrue(oProviders.Count > 0, "No SMPP providers found"); res = NotificationDevice.AddSmsDevice(_connectionServer, _tempUser.ObjectId, Guid.NewGuid().ToString(), oProviders[0].ObjectId, "*****@*****.**", "*****@*****.**", "DispatchMessage", true); Assert.IsTrue(res.Success, "Failed to create new SMS notification device:" + 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); }