コード例 #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
ファイル: SayTests.cs プロジェクト: liqdfire/SlackConnector
        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));
        }