Example #1
0
        public async Task OnTurn_Init()
        {
            // Arrange
            var turnContext = A.Fake <ITurnContext>();
            var activity    = new Activity()
            {
                ActivityType = ActivityType.Message, Text = "/init", ChatId = 15
            };

            A.CallTo(() => turnContext.Activity).Returns(activity);
            A.CallTo(() => turnContext.CurrentDialog).Returns(null);
            var initDialog = A.Fake <IDialog>();

            A.CallTo(() => initDialog.Command).Returns("/init");
            _target.AddDialog(initDialog);
            // Act
            await _target.OnTurn(turnContext);

            // Assert
            A.CallTo(() => turnContext.Begin(initDialog)).MustHaveHappened();
            A.CallTo(() => turnContext.Continue()).MustHaveHappened();
        }