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); }
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(); }
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); }