Example #1
0
        public IHttpActionResult Schedule([FromBody] ScheduledBundleRequest request)
        {
            var job      = new ScheduledBundleJob(request);
            var response = this.JobsManager.Schedule <ScheduledBundleJob, ScheduledResponse>(job);

            return(this.CreatedAtRoute("DefaultApi", new { controller = "jobs", id = response.Id }, response));
        }
Example #2
0
        public async Task Test_BasicAuth()
        {
            var schedule = new DateTimeOffset(DateTime.Now);

            var request = new ScheduledBundleRequest(schedule);

            request.HttpRequests.Add(NewHttpRequestMessageWithBasicAuth());

            var response = await this.client.ScheduleAsync(request)
                           .ConfigureAwait(false);

            Assert.NotNull(response.Id);
            Assert.Equal(schedule, response.Schedule);
        }
Example #3
0
        public async Task Test_MailAttachments()
        {
            var schedule = new DateTimeOffset(DateTime.Now);

            var request = new ScheduledBundleRequest(schedule);

            request.MailMessages.Add(NewMailMessageWithAttachments());

            var response = await this.client.ScheduleAsync(request)
                           .ConfigureAwait(false);

            Assert.NotNull(response.Id);
            Assert.Equal(schedule, response.Schedule);
        }
Example #4
0
        public async Task Test_Schedule()
        {
            var schedule = new DateTimeOffset(DateTime.Now);

            var request = new ScheduledBundleRequest(schedule);

            request.MailMessages.Add(NewMailMessage());
            request.HttpRequests.Add(NewHttpRequestMessage());
            request.ApexnetPushNotifications.Add(NewApexnetPushNotification());

            var response = await this.client.ScheduleAsync(request)
                           .ConfigureAwait(false);

            Assert.NotNull(response.Id);
            Assert.Equal(schedule, response.Schedule);
        }