public void FixtureSetup() { Client = new RestLabelClient(MockClient.User(), MockClient.Password()); BroadcastClient = new RestBroadcastClient(MockClient.User(), MockClient.Password()); var localTimeZoneRestriction = new CfLocalTimeZoneRestriction(DateTime.Now, DateTime.Now); CfResult[] result = { CfResult.Received }; CfRetryPhoneType[] phoneTypes = { CfRetryPhoneType.FirstNumber }; var broadcastConfigRestryConfig = new CfBroadcastConfigRetryConfig(1000, 2, result, phoneTypes); var expectedTextBroadcastConfig = new CfTextBroadcastConfig(1, DateTime.Now, string.Empty, localTimeZoneRestriction, broadcastConfigRestryConfig, "Test", CfBigMessageStrategy.DoNotSend); var expectedBroadcast = new CfBroadcast(14898, "broadcastSoap", CfBroadcastStatus.Running, DateTime.Now, CfBroadcastType.Text, expectedTextBroadcastConfig); var broadcastRequest = new CfBroadcastRequest("", expectedBroadcast); BroadcastId = BroadcastClient.CreateBroadcast(broadcastRequest); LabelName = "New RestLabel"; Broadcast = new CfBroadcast { Name = "Name", Type = CfBroadcastType.Text, Item = new CfTextBroadcastConfig { FromNumber = VerifyShortCode, RetryConfig = new CfBroadcastConfigRetryConfig { RetryPhoneTypes = new[] { CfRetryPhoneType.FirstNumber }, RetryResults = new[] { CfResult.NoAns } }, Message = "Message Test", }, }; }
public void FixtureSetup() { Client = new RestBroadcastClient(MockClient.User(), MockClient.Password()); var localTimeZoneRestriction = new CfLocalTimeZoneRestriction(DateTime.Now, DateTime.Now); CfResult[] result = { CfResult.Received }; CfRetryPhoneType[] phoneTypes = { CfRetryPhoneType.FirstNumber }; var broadcastConfigRestryConfig = new CfBroadcastConfigRetryConfig(1000, 2, result, phoneTypes); var expectedTextBroadcastConfig = new CfTextBroadcastConfig(1, DateTime.Now, string.Empty, localTimeZoneRestriction, broadcastConfigRestryConfig, "Test", CfBigMessageStrategy.DoNotSend); ExpectedBroadcastDefault = new CfBroadcast(14898, "broadcastRest", CfBroadcastStatus.StartPending, DateTime.Now, CfBroadcastType.Text, expectedTextBroadcastConfig); CfBroadcastType[] broadcastType = { CfBroadcastType.Text }; CfQueryBroadcasts = new CfQueryBroadcasts(100, 0, broadcastType, null, null); QueryContactBatches = new CfQueryBroadcastData(100, 0, 1838228001); ControlContactBatches = new CfControlContactBatch(1092170001, "ContactBatchRest", true); GetBroadcastStats = new CfGetBroadcastStats(1838228001, new DateTime(2014, 01, 01), new DateTime(2014, 12, 01)); var textBroadcastConfig = new CfTextBroadcastConfig(1, DateTime.Now, "67076", null, null, "Test Message Rest", CfBigMessageStrategy.DoNotSend); var broadcast = new CfBroadcast(1838228001, "broadcastUpdated_Rest", CfBroadcastStatus.Running, DateTime.Now, CfBroadcastType.Text, textBroadcastConfig); UpdateBroadcast = new CfBroadcastRequest("", broadcast); ControlBroadcast = new CfControlBroadcast(0, null, CfBroadcastCommand.Archive, null); const long id = 188717001; object[] contactList = { id }; CreateContactBatch = new CfCreateContactBatch(null, 1907978001, "ContactBatchSoap", contactList, false); }
public void Test_CreateBroadcast() { var broadcast = new CfBroadcast(ExpectedBroadcast.Id, ExpectedBroadcast.Name, ExpectedBroadcast.Status, ExpectedBroadcast.LastModified, ExpectedBroadcast.Type, ExpectedBroadcast.Item); var broadcastRequest = new CfBroadcastRequest("", broadcast); var id = Client.CreateBroadcast(broadcastRequest); Assert.AreEqual(ExpectedBroadcast.Id, id); }
public long CreateBroadcast(CfBroadcastRequest createBroadcast) { return BroadcastService.CreateBroadcast(new BroadcastRequest(createBroadcast.RequestId, BroadcastMapper.ToSoapBroadcast(createBroadcast.Broadcast))); }
public void UpdateBroadcast(CfBroadcastRequest updateBroadcast) { BroadcastService.UpdateBroadcast(new BroadcastRequest(updateBroadcast.RequestId, BroadcastMapper.ToSoapBroadcast(updateBroadcast.Broadcast))); }
public void Test_UpdateBroadcast() { var broadcast = new CfBroadcast(BroadcastId, BroadcastName, CfBroadcastStatus.Running, DateTime.Now, CfBroadcastType.Text, null); var broadcastRequest = new CfBroadcastRequest("", broadcast); Client.UpdateBroadcast(broadcastRequest); }