예제 #1
0
        public async Task should_send_typing_indicator()
        {
            // given
            SlackChatHub channel = SlackConnection.ConnectedChannel(Config.Slack.TestChannel);

            // when
            await SlackConnection.IndicateTyping(channel);

            // then
        }
예제 #2
0
        public async Task should_upload_to_channel_from_file_system()
        {
            // given
            var chatHub = SlackConnection.ConnectedChannel(Config.Slack.TestChannel);

            // when
            await SlackConnection.Upload(chatHub, _filePath);

            // then
        }
예제 #3
0
        public async Task should_upload_to_channel_from_stream()
        {
            // given
            var          chatHub  = SlackConnection.ConnectedChannel(Config.Slack.TestChannel);
            const string fileName = "slackconnector-test-stream-upload.txt";

            // when
            using (var fileStream = EmbeddedResourceFileReader.ReadEmbeddedFile("UploadTest.txt"))
            {
                await SlackConnection.Upload(chatHub, fileStream, fileName);
            }

            // then
        }
예제 #4
0
        public async Task should_say_something_on_channel()
        {
            // given
            var message = new BotMessage
            {
                Text    = "Test text for INT test",
                ChatHub = SlackConnection.ConnectedChannel(Config.Slack.TestChannel)
            };

            // when
            await SlackConnection.Say(message);

            // then
        }
예제 #5
0
        public async Task should_say_something_on_channel()
        {
            // given
            var message = new BotMessage
            {
                Text    = "Test text for INT test",
                ChatHub = SlackConnection.ConnectedChannel(Config.Slack.TestChannel)
            };

            // when
            await SlackConnection.Say(message);

            SlackConnection.OnMessageReceived += slackMessage =>
            {
                _output.WriteLine(slackMessage.Text);
                return(Task.CompletedTask);
            };

            // then
            //await Task.Delay(TimeSpan.FromMinutes(2));
        }