Beispiel #1
0
        public async void ContinueConversationAsyncShouldFailWithNullLogic()
        {
            var webexAdapter          = new WebexAdapter(new Mock <WebexClientWrapper>(_testOptions).Object, _adapterOptions);
            var conversationReference = new ConversationReference();

            await Assert.ThrowsAsync <ArgumentNullException>(async() => { await webexAdapter.ContinueConversationAsync(conversationReference, null, default); });
        }
Beispiel #2
0
        public async void ContinueConversationAsyncShouldFailWithNullConversationReference()
        {
            var webexAdapter = new WebexAdapter(new Mock <WebexClientWrapper>(_testOptions).Object, _adapterOptions);

            Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
            {
                return(Task.CompletedTask);
            }

            await Assert.ThrowsAsync <ArgumentNullException>(async() => { await webexAdapter.ContinueConversationAsync(null, BotsLogic, default); });
        }
Beispiel #3
0
        public async void ContinueConversationAsyncShouldSucceed()
        {
            var callbackInvoked = false;

            var webexAdapter          = new WebexAdapter(new Mock <WebexClientWrapper>(_testOptions).Object, _adapterOptions);
            var conversationReference = new ConversationReference();

            Task BotsLogic(ITurnContext turnContext, CancellationToken cancellationToken)
            {
                callbackInvoked = true;
                return(Task.CompletedTask);
            }

            await webexAdapter.ContinueConversationAsync(conversationReference, BotsLogic, default);

            Assert.True(callbackInvoked);
        }