public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);
            ExpectedBroadcast = new CfBroadcast(1, "broadcast", CfBroadcastStatus.Running, DateTime.Now, CfBroadcastType.Voice, null);

            CreateExpectedBroadcast(1);

            LocalTimeZoneRestriction = new CfLocalTimeZoneRestriction(DateTime.Now, DateTime.Now);
            CfResult[] result = { CfResult.CarrierTempError };
            CfRetryPhoneType[] phoneTypes = { CfRetryPhoneType.FirstNumber };
            BroadcastConfigRestryConfig = new CfBroadcastConfigRetryConfig(1000, 2, result, phoneTypes);

            ExpectedVoiceBroadcastConfig = new CfVoiceBroadcastConfig(1, DateTime.Now, "fromNumber",
                null, BroadcastConfigRestryConfig, CfAnsweringMachineConfig.AmAndLive, "item",
                "liveSoundTextVoice", "item1", "machineSoundTextVoice", "item2", "tranferSoudnTextVoice", "1", "123456",
                "item3", "DncSoundTextVoice", "1", 5);
            ExpectedBroadcast.Item = ExpectedVoiceBroadcastConfig;

            CreateExpectedBroadcast(2);

            ExpectedVoiceBroadcastConfig.LocalTimeZoneRestriction = LocalTimeZoneRestriction;
            ExpectedVoiceBroadcastConfig.RetryConfig = null;
            ExpectedBroadcast.Item = ExpectedVoiceBroadcastConfig;

            CreateExpectedBroadcast(3);
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            CfDaysOfWeek[] daysOfWeek = {CfDaysOfWeek.Monday};
            BroadcastSchedule = new CfBroadcastSchedule(BroadcastScheduleId, DateTime.Now, DateTime.Now, "timeZone", DateTime.Now, DateTime.Now, daysOfWeek);
            CreateBroadcastSchedule = new CfCreateBroadcastSchedule("requestId", BroadcastScheduleId, BroadcastSchedule);

            BroadcastServiceMock
                .Stub(
                    b =>
                        b.CreateBroadcastSchedule(
                            Arg<CreateBroadcastSchedule>.Matches(
                                x => x.RequestId == CreateBroadcastSchedule.RequestId &&
                                     x.BroadcastId == CreateBroadcastSchedule.BroadcastId &&
                                     x.BroadcastSchedule.id == BroadcastSchedule.Id &&
                                     x.BroadcastSchedule.BeginDate == BroadcastSchedule.BeginDate &&
                                     x.BroadcastSchedule.EndDate == BroadcastSchedule.EndDate &&
                                     x.BroadcastSchedule.TimeZone == BroadcastSchedule.TimeZone &&
                                     x.BroadcastSchedule.StartTimeOfDay == BroadcastSchedule.StartTimeOfDay &&
                                     x.BroadcastSchedule.StopTimeOfDay == BroadcastSchedule.StopTimeOfDay &&
                                     x.BroadcastSchedule.DaysOfWeek == BroadcastSchedule.DaysOfWeek.ToString().ToUpper())))
                .Return(BroadcastScheduleId);
        }
        public void FixtureSetup()
        {
            Client = new SoapLabelClient(MockClient.User(), MockClient.Password());
            BroadcastClient = new SoapBroadcastClient(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, null, 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 SoapLabel";

            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 SoapBroadcastClient(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, null, localTimeZoneRestriction,
                broadcastConfigRestryConfig, "Test", CfBigMessageStrategy.DoNotSend);
            ExpectedBroadcastDefault = new CfBroadcast(14898, "broadcastSoap", 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, "ContactBatchSoap", false);
            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 Soap", CfBigMessageStrategy.DoNotSend);
            var broadcast = new CfBroadcast(1838228001, "broadcastUpdated_Soap", 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("", 1907978001, "ContactBatchSoap", contactList, false);
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            BroadcastScheduleId = 1;

            BroadcastServiceMock.Stub(b => b.DeleteBroadcastSchedule(Arg<IdRequest>.Matches(x => x.Id == BroadcastScheduleId)));
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);
            ExpectedControlBroadcast = new CfControlBroadcast(1, "123", CfBroadcastCommand.Start, 5);

            BroadcastServiceMock
                .Stub(b => b.ControlBroadcast(Arg<ControlBroadcast>.Matches(x => x.Id == ExpectedControlBroadcast.Id &&
                                                                                 x.RequestId == ExpectedControlBroadcast.RequestId &&
                                                                                 x.MaxActive == ExpectedControlBroadcast.MaxActive &&
                                                                                 x.Command == BroadcastCommand.START)));

        }
        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()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            ContactBatchId = 1;
            ExpectedContactBatch = new CfContactBatch(ContactBatchId, "contactBatch", CfBatchStatus.Active, 5, DateTime.Now, 200, 10);

            var contactBatch = ContactBatchMapper.ToSoapContactBatch(ExpectedContactBatch);
            BroadcastServiceMock
                .Stub(b => b.GetContactBatch(Arg<IdRequest>.Matches(x => x.Id == ContactBatchId)))
                .Return(contactBatch);
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            BroadcastScheduleId = 1;
            CfDaysOfWeek[] daysOfWeek = { CfDaysOfWeek.Monday };
            BroadcastSchedule = new CfBroadcastSchedule(BroadcastScheduleId, DateTime.Now, DateTime.Now, "timeZone", DateTime.Now, DateTime.Now, daysOfWeek);

            var broadcastSchedule = BroadcastScheduleMapper.ToSoapBroadcastSchedule(BroadcastSchedule);
            BroadcastServiceMock
                .Stub(b => b.GetBroadcastSchedule(Arg<IdRequest>.Matches(x => x.Id == BroadcastScheduleId)))
                .Return(broadcastSchedule);
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            ExpectedBroadcast = new CfBroadcast(1, "broadcast", CfBroadcastStatus.Running, DateTime.Now, CfBroadcastType.Text, null);

            BroadcastServiceMock
                .Stub(b => b.CreateBroadcast(Arg<BroadcastRequest>.Matches(x => x.Broadcast.id == ExpectedBroadcast.Id &&
                                                                                x.Broadcast.Name == ExpectedBroadcast.Name &&
                                                                                x.Broadcast.LastModified == ExpectedBroadcast.LastModified &&
                                                                                x.Broadcast.Status == BroadcastStatus.RUNNING &&
                                                                                x.Broadcast.Type == BroadcastType.TEXT)))
                .Return(ExpectedBroadcast.Id == null ? 0 : ExpectedBroadcast.Id.Value);
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            BroadcastId = 1;
            BroadcastName = "broadcast";

            BroadcastServiceMock
                .Stub(b => b.UpdateBroadcast(Arg<BroadcastRequest>.Matches(x => x.Broadcast.id == BroadcastId &&
                                                                                 x.Broadcast.Name == BroadcastName &&
                                                                                 x.Broadcast.Status == BroadcastStatus.RUNNING &&
                                                                                 x.Broadcast.LastModified == DateTime.Now &&
                                                                                 x.Broadcast.Type == BroadcastType.TEXT)));
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            BroadcastId = 2;
            const long id = 188717001;
            object[] contactList = { id };
            ExpectedCreateContactBatch = new CfCreateContactBatch("1", BroadcastId, "name", contactList, false);

            BroadcastServiceMock
                .Stub(b => b.CreateContactBatch(Arg<CreateContactBatch>.Matches(x => x.RequestId == ExpectedCreateContactBatch.RequestId &&
                                                                                x.BroadcastId == ExpectedCreateContactBatch.BroadcastId &&
                                                                                x.Name == ExpectedCreateContactBatch.Name &&
                                                                                x.ScrubBroadcastDuplicates == ExpectedCreateContactBatch.ScrubBroadcastDuplicates)))
                .Return(BroadcastId);
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            ExpectedQueryBroadcastData = new CfQueryBroadcastData(500, 0, 1);

            ExpectedContactBatch = new CfContactBatch(1, "contactBatch", CfBatchStatus.Active, 2, DateTime.Now, 10, 15);

            var contactBatchArray = new CfContactBatch[1];
            contactBatchArray[0] = ExpectedContactBatch;

            ExpectedContactBatchQueryResult = new CfContactBatchQueryResult(10, contactBatchArray);

            BroadcastServiceMock
                .Stub(b => b.QueryContactBatches( Arg<QueryContactBatches>.Matches(x => x.MaxResults == ExpectedQueryBroadcastData.MaxResults &&
                                                                                        x.FirstResult == ExpectedQueryBroadcastData.FirstResult &&
                                                                                        x.BroadcastId == ExpectedQueryBroadcastData.BroadcastId)))
                .Return(ContactBatchQueryResultMapper.ToSoapContactBatchQueryResult(ExpectedContactBatchQueryResult));
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            BroadcastId = 1;
            GetBroadcastStats = new CfGetBroadcastStats(BroadcastId, DateTime.Now, DateTime.Now);
            ExpectedUsageStats = new BroadcastStatsUsageStats(5, 5, 2, 10, 2);

            var resultStat = new BroadcastStatsResultStat[1];
            ExpectedResultStat = new BroadcastStatsResultStat("result", 2, 3);
            resultStat[0] = ExpectedResultStat;

            ExpectedActionsStatistics = new BroadcastStatsActionStatistics(2, 0, 10);

            var expectedBroadcastStats = new BroadcastStats(ExpectedUsageStats, resultStat, ExpectedActionsStatistics);
            BroadcastServiceMock
                .Stub(b => b.GetBroadcastStats(Arg<GetBroadcastStats>.Matches(x => x.Id == BroadcastId)))
                .Return(expectedBroadcastStats);
        }
        public void FixtureSetup()
        {
            BroadcastServiceMock = MockRepository.GenerateStub<IBroadcastServicePortTypeClient>();
            Client = new SoapBroadcastClient(BroadcastServiceMock);

            BroadcastId = 1;
            QueryBroadcastSchedule = new CfQueryBroadcastData(100, 1, BroadcastId);

            CfDaysOfWeek[] daysOfWeek = {CfDaysOfWeek.Monday};
            BroadcastSchedule = new CfBroadcastSchedule(1, DateTime.Now, DateTime.Now, "timeZone", DateTime.Now, DateTime.Now, daysOfWeek);
            var broadcastSchedule = new CfBroadcastSchedule[1];
            broadcastSchedule[0] = BroadcastSchedule;
            BroadcastScheduleQueryResult = new CfBroadcastScheduleQueryResult(1, broadcastSchedule);

            var broadcastScheduleQueryResult = BroadcastScheduleQueryResultMapper.ToSoapBroadcastScheduleQueryResult(BroadcastScheduleQueryResult);
            GenerateMock(BroadcastId, broadcastScheduleQueryResult);

            BroadcastId = 2;
            BroadcastScheduleQueryResult.BroadcastSchedule = null;
            broadcastScheduleQueryResult = BroadcastScheduleQueryResultMapper.ToSoapBroadcastScheduleQueryResult(BroadcastScheduleQueryResult);
            GenerateMock(BroadcastId, broadcastScheduleQueryResult);
        }