コード例 #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));
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }