public void ShouldNotImplicitlySetAValueForAuthType() { NotificationConfig notificationConfig = new NotificationConfigBuilder() .Build(); Assert.IsNull(notificationConfig.AuthType); }
public void ShouldBuildForTaskCompletion() { NotificationConfig notificationConfig = new NotificationConfigBuilder() .ForTaskCompletion() .Build(); Assert.AreEqual("TASK_COMPLETION", notificationConfig.Topics.Single()); }
public void ShouldBuildForResourceUpdate() { NotificationConfig notificationConfig = new NotificationConfigBuilder() .ForResourceUpdate() .Build(); Assert.AreEqual("RESOURCE_UPDATE", notificationConfig.Topics.Single()); }
public void ShouldBuildWithAuthTypeBearer() { NotificationConfig notificationConfig = new NotificationConfigBuilder() .WithAuthTypeBearer() .Build(); Assert.AreEqual(DocScanConstants.Bearer, notificationConfig.AuthType); }
public void ShouldBuildWithTopic() { string topicName = "someTopic"; NotificationConfig notificationConfig = new NotificationConfigBuilder() .WithTopic(topicName) .Build(); Assert.AreEqual(topicName, notificationConfig.Topics.Single()); }
public void ShouldBuildWithEndpoint() { string endpoint = "someEndpoint"; NotificationConfig notificationConfig = new NotificationConfigBuilder() .WithEndpoint(endpoint) .Build(); Assert.AreEqual(endpoint, notificationConfig.Endpoint); }
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); }
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( }