示例#1
0
        public void ShouldNotImplicitlySetAValueForAuthType()
        {
            NotificationConfig notificationConfig =
                new NotificationConfigBuilder()
                .Build();

            Assert.IsNull(notificationConfig.AuthType);
        }
示例#2
0
        public void ShouldBuildForTaskCompletion()
        {
            NotificationConfig notificationConfig =
                new NotificationConfigBuilder()
                .ForTaskCompletion()
                .Build();

            Assert.AreEqual("TASK_COMPLETION", notificationConfig.Topics.Single());
        }
示例#3
0
        public void ShouldBuildForResourceUpdate()
        {
            NotificationConfig notificationConfig =
                new NotificationConfigBuilder()
                .ForResourceUpdate()
                .Build();

            Assert.AreEqual("RESOURCE_UPDATE", notificationConfig.Topics.Single());
        }
示例#4
0
        public void ShouldBuildWithAuthTypeBearer()
        {
            NotificationConfig notificationConfig =
                new NotificationConfigBuilder()
                .WithAuthTypeBearer()
                .Build();

            Assert.AreEqual(DocScanConstants.Bearer, notificationConfig.AuthType);
        }
示例#5
0
        public void ShouldBuildWithTopic()
        {
            string topicName = "someTopic";

            NotificationConfig notificationConfig =
                new NotificationConfigBuilder()
                .WithTopic(topicName)
                .Build();

            Assert.AreEqual(topicName, notificationConfig.Topics.Single());
        }
示例#6
0
        public void ShouldBuildWithEndpoint()
        {
            string endpoint = "someEndpoint";

            NotificationConfig notificationConfig =
                new NotificationConfigBuilder()
                .WithEndpoint(endpoint)
                .Build();

            Assert.AreEqual(endpoint, notificationConfig.Endpoint);
        }
示例#7
0
        public void ShouldBuildWithAuthToken()
        {
            string authToken = "someAuthToken";

            NotificationConfig notificationConfig =
                new NotificationConfigBuilder()
                .WithAuthToken(authToken)
                .Build();

            Assert.AreEqual(authToken, notificationConfig.AuthToken);
        }
        public void ShouldBuildWithNotifications()
        {
            string topic = "topic";

            NotificationConfig notifications = new NotificationConfigBuilder()
                                               .WithTopic(topic)
                                               .Build();

            SessionSpecification sessionSpec =
                new SessionSpecificationBuilder()
                .WithNotifications(notifications)
                .Build();

            Assert.AreEqual(topic, sessionSpec.Notifications.Topics.Single());
        }
 public async void SendGridTest()
 {
     var config = NotificationConfigBuilder.Build();
     var sgc    = new NotificationConfiguration {
         APIKey = config.APIKey
     };
     var sendgrid = new Email
     {
         Subject = "*****@*****.**",
         To      = new System.Collections.Generic.List <string> {
             "*****@*****.**"
         },
         Content = "Hello world"
     };
     var publisher = new NotificationPublisher <SendGridNotificationAgent <Notification.Concerns.Notification> >(sgc);
     var obj       = publisher.Publish(sendgrid);
 }
示例#10
0
        public async void Test1()
        {
            var config = NotificationConfigBuilder.Build();
            var args   = new NotificationConfiguration
            {
                Host     = config.Host,
                Port     = config.Port,
                UserName = config.UserName,
                Password = config.Password
            };
            var smtp = new Email
            {
                Subject = "*****@*****.**",
                To      = new System.Collections.Generic.List <string> {
                    "*****@*****.**"
                },
                Content = "Hello world"
            };

            var publisher = new NotificationPublisher <SMTPNotificationAgent <Notification.Concerns.Notification> >(args);
            var obj       = publisher.Publish(smtp);

            // await obj.SendAsync(
        }