internal static CfBroadcastSchedule FromSoapBroadcastSchedule(BroadcastSchedule source)
 {
     if (source == null)
     {
         return null;
     }
     var daysOfWeek = EnumeratedMapper.ArrayFromSoapEnumerated<CfDaysOfWeek>(source.DaysOfWeek);
     return new CfBroadcastSchedule(source.id, source.StartTimeOfDay, source.StopTimeOfDay, source.TimeZone,
         source.BeginDate, source.EndDate, daysOfWeek);
 }
        private void GenerateMock(BroadcastScheduleQueryResult broadcastScheduleQueryResult)
        {
            var resource = new ResourceList();
            var array = new BroadcastSchedule[1];
            array[0] = broadcastScheduleQueryResult.BroadcastSchedule[0];
            resource.Resource = array;
            resource.TotalResults = 1;

            var serializer = new XmlSerializer(typeof(ResourceList));
            TextWriter writer = new StringWriter();
            serializer.Serialize(writer, resource);

            HttpClientMock
                .Stub(j => j.Send(Arg<string>.Is.Equal(String.Format("/broadcast/{0}/schedule",BroadcastId)),
                    Arg<HttpMethod>.Is.Equal(HttpMethod.Get),
                    Arg<object>.Is.Anything))
                .Return(writer.ToString());
        }