示例#1
0
        public async void ContinueConversationAsyncShouldFailWithNullConversationReference()
        {
            var alexaAdapter = new AlexaAdapter(new Mock <AlexaAdapterOptions>().Object);

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

            await Assert.ThrowsAsync <ArgumentNullException>(async() => { await alexaAdapter.ContinueConversationAsync(null, BotsLogic, default); });
        }
示例#2
0
        public async void ContinueConversationAsyncShouldSucceed()
        {
            var callbackInvoked = false;

            var alexaAdapter          = new AlexaAdapter(new Mock <AlexaAdapterOptions>().Object);
            var conversationReference = new ConversationReference();

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

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

            Assert.True(callbackInvoked);
        }