Setup UserData for unit testing
问题 How do i setup the UserData within the context for unit testing? var context = new Mock<IDialogContext>(); context.Setup(c => c.Activity).Returns(() => new Activity()); context.Setup(c => c.UserData).Returns(() => ?); Should i use BotData? 回答1: Used the "DialogTestBase" class from BotBuilder tests and this worked for me. IBotDataBag dataBag; var container = Build(Options.LastWriteWinsCachingBotDataStore); var msg = MakeTestMessage(); using (var scope = DialogModule.BeginLifetimeScope