private static AttachmentDto CreateQuestionAttachment(SearchableQuestion question) { var showAnswersParams = JsonConvert.SerializeObject(new ShowAnswersActionButtonParams { QuestionId = question.Id }); return(new AttachmentDto { Color = Color.Turquoise, Title = $"{Phrases.QuestionInfoTitle}{question.Text}", CallbackId = CallbackId.ShowAnswersButtonId, Actions = new List <AttachmentActionDto> { new ShowAnswersButtonAttachmentAction(showAnswersParams) } }); }
public EventServiceTests() { var elasticsearchSettingsMock = new Mock <IOptions <ElasticsearchSettings> >(); elasticsearchSettingsMock .SetupGet(m => m.Value) .Returns(() => new ElasticsearchSettings()); _elasticSearchService = new Mock <IElasticSearchService>(); _slackClientMock = new Mock <ISlackHttpClient>(); _searchableTextServiceMock = new Mock <ISearchableTextService>(); var logger = new Mock <ILogger <EventService> >(); _eventService = new EventService(_slackClientMock.Object, _elasticSearchService.Object, _searchableTextServiceMock.Object, logger.Object); var slackEvent = new SlackEvent { Text = "Hello from Slack!", Channel = "CBGJMA0TA", UserId = "UBJ6GC75K", Type = "message" }; _request = new EventWrapperRequest { Event = slackEvent }; _question = new SearchableQuestion { Id = Guid.NewGuid().ToString(), Text = "???" }; _answer = new SearchableAnswer() { Text = "???", Id = Guid.NewGuid().ToString(), QuestionId = Guid.NewGuid().ToString() }; }