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 ControlContactBatch(CfControlContactBatch cfControlContactBatch) : base(cfControlContactBatch.Id) { Name = cfControlContactBatch.Name; if (cfControlContactBatch.Enabled.HasValue) { Enabled = cfControlContactBatch.Enabled.Value; EnabledSpecified = true; } }
public void FixtureSetup() { BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>(); Client = new SoapBroadcastClient(BroadcastServiceMock); ControlContactBatchId = 1; ExpectedControlContactBatch = new CfControlContactBatch(ControlContactBatchId, "controlContactBatch", false); BroadcastServiceMock .Stub(b => b.ControlContactBatch(Arg<ControlContactBatch>.Matches(x => x.Id == ExpectedControlContactBatch.Id && x.Name == ExpectedControlContactBatch.Name && x.Enabled == ExpectedControlContactBatch.Enabled))); }
public void FixtureSetup() { HttpClientMock = MockRepository.GenerateMock<IHttpClient>(); Client = new RestBroadcastClient(HttpClientMock); ControlContactBatchId = 1; ExpectedControlContactBatch = new CfControlContactBatch(ControlContactBatchId, "controlContactBatch", true); HttpClientMock .Stub(j => j.Send(Arg<string>.Is.Equal(String.Format("/broadcast/batch/{0}/control", ControlContactBatchId)), Arg<HttpMethod>.Is.Equal(HttpMethod.Put), Arg<ControlContactBatch>.Matches(x => x.Id == ExpectedControlContactBatch.Id && x.Name == ExpectedControlContactBatch.Name && x.Enabled == ExpectedControlContactBatch.Enabled))) .Return(string.Empty); }
public void ControlContactBatch(CfControlContactBatch controlContactBatch) { BroadcastService.ControlContactBatch(new ControlContactBatch(controlContactBatch)); }