示例#1
0
 public async Task MainDialog_NullCreateContextAsync()
 {
     var convoState          = new ConversationState(new MemoryStorage());
     var dialogStateProperty = convoState.CreateProperty <DialogState>("dialogstate");
     var mainDialog          = new TestMainDialog(dialogStateProperty);
     var dc = await mainDialog.RunAsync(null);
 }
示例#2
0
        public async Task MainDialog_DerivedMainDialog()
        {
            var convoState = new ConversationState(new MemoryStorage());

            var adapter = new TestAdapter()
                          .Use(new AutoSaveStateMiddleware(convoState));

            var mainDialog = new TestMainDialog(convoState.CreateProperty <DialogState>("dialogState"));

            await new TestFlow(adapter, async(turnContext, cancellationToken) =>
            {
                await mainDialog.RunAsync(turnContext).ConfigureAwait(false);
            })
            .Send("hello")
            .AssertReply("step1")
            .AssertReply("step1.1")
            .Send("hello")
            .AssertReply("step1.2")
            .Send("hello")
            .AssertReply("step2")
            .AssertReply("step2.1")
            .Send("hello")
            .AssertReply("step2.2")
            .StartTestAsync();
        }
示例#3
0
 public async Task MainDialog_CreateContextAsync()
 {
     var convoState          = new ConversationState(new MemoryStorage());
     var dialogStateProperty = convoState.CreateProperty <DialogState>("dialogstate");
     var mainDialog          = new TestMainDialog(dialogStateProperty);
     var context             = TestUtilities.CreateEmptyContext();
     var dc = await mainDialog.RunAsync(context);
 }