/// <summary> /// Creates the Slack-bot. /// </summary> /// <param name="slackIntegration">Used for talking to the Slack APIs.</param> /// <param name="slackProfileValidator">Used for checking user profiles for completeness.</param> /// <param name="adminUser">Used for sending the results to the Slack admin.</param> public ProfilebotImplmentation(ISlackIntegration slackIntegration, ISlackProfileValidator slackProfileValidator, AdminUser adminUser) { this.slackIntegration = slackIntegration ?? throw new ArgumentNullException(nameof(slackIntegration)); this.slackProfileValidator = slackProfileValidator ?? throw new ArgumentNullException(nameof(slackProfileValidator)); if (string.IsNullOrEmpty(adminUser.Id)) { throw new ArgumentException(nameof(adminUser.Id)); } adminUserId = adminUser.Id; }
/// <summary> /// Creates the Slack-bot. /// </summary> /// <param name="slackIntegration">Used for talking to the Slack APIs.</param> /// <param name="slackProfileValidator">Used for checking user profiles for completeness.</param> /// <param name="adminUser">Used for sending the results to the Slack admin.</param> /// <param name="faceWhitelist">Knows about whitelisted users.</param> public ProfilebotImplmentation(ISlackIntegration slackIntegration, ISlackProfileValidator slackProfileValidator, SlackUser adminUser, IFaceWhitelist faceWhitelist) { this.slackIntegration = slackIntegration ?? throw new ArgumentNullException(nameof(slackIntegration)); this.slackProfileValidator = slackProfileValidator ?? throw new ArgumentNullException(nameof(slackProfileValidator)); if (string.IsNullOrEmpty(adminUser.Id)) { throw new ArgumentException(nameof(adminUser.Id)); } this.adminUser = new SlackUser { Id = adminUser.Id }; this.faceWhitelist = faceWhitelist ?? throw new ArgumentNullException(nameof(faceWhitelist)); }
public SlackProfileValidatorTests() { slackProfileValidator = new SlackProfileValidator(new AdminUser("U1TBU8336")); }