public void PingdomGetResponseTest() { List <SlackAttachment> attach = new List <SlackAttachment>(); attach.Add(new SlackAttachment() { Title = "ICR:Bug:Critical:Test Jira Ticket. Virtual System is down (#9999)", Text = "ICR:Bug:Critical:Test Jira Ticket. Virtual System is down (#9999)" }); ResponseContext context = new ResponseContext() { Message = new SlackMessage() { Attachments = attach } }; string loc = Assembly.GetExecutingAssembly().Location; string location = Path.GetDirectoryName(loc); ConfigController cfg = new ConfigController(location); if (cfg.LoadConfig()) { SlackBotController sbc = new SlackBotController(cfg); PingdomResponder ping = new PingdomResponder(sbc); BotMessage bm = ping.GetResponse(context); Assert.True(bm.Text.Contains("Jira Ticket")); } }
public void CreateJiraTicket() { ConfigController cfg = new ConfigController(AppDomain.CurrentDomain.BaseDirectory); SlackBotController bot = new SlackBotController(cfg); PikettResponder sr = new PikettResponder(bot); sr.GetResponse(null); Assert.IsNotNull(true); }
/// <summary> /// Initializes a new instance of the <see cref="MainProgram"/> class. /// </summary> /// <param name="location">The location.</param> public MainProgram() { log4net.Config.XmlConfigurator.Configure(); string location = AppDomain.CurrentDomain.BaseDirectory; _logger.Info("Starting main app from location " + location); ConfigController cfg = new ConfigController(location); if (cfg.LoadConfig()) { _logger.Info("Config loaded, starting modules"); _slackBot = new SlackBotController(cfg); _slackBot.InitBot(); _slackBot.onMessageReceived += _slackBot_onMessageReceived; _logger.Info("Ready"); } else { _logger.Warn("Unable to load config file"); } }
public TaskResponder(SlackBotController botController) { _botController = botController; _icZeroBotConnector = new IcZeroBotConnector(botController.cfg.Get("ZeroBot", "BusinessLogicEndPoint", "http://ic-zerobot.infocentric.ch/api")); }