Ejemplo n.º 1
0
        public async Task OnboardingReceiverUnitTest(bool isFirst, string teamDivision)
        {
            var message = new Message
            {
                From    = UnitTestBuilder.GetUserNode(),
                To      = UnitTestBuilder.GetBotNode(),
                Content = PlainText.Parse("UnitTest_" + teamDivision)
            };
            var userContext = new UserContext
            {
                FirstInteraction = isFirst
            };
            bool success = false;

            try
            {
                success = await flowService.SendOnboardingFlowAsync(userContext, message, CancellationToken.None);

                userContext = await contextManager.GetUserContextAsync(message.From, CancellationToken.None);
            }
            catch (Exception ex)
            {
                ex.ShouldBeNull();
            }
            finally
            {
                success.ShouldBeTrue();
                if (!isFirst)
                {
                    userContext.TeamDivision.ShouldBe(teamDivision);
                }
            }
        }
Ejemplo n.º 2
0
 protected override async Task ReceiveMessageAsync(Message message, Contact contact, UserContext userContext, CancellationToken cancellationToken)
 {
     await _flowService.SendOnboardingFlowAsync(userContext, message, cancellationToken);
 }