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); } } }
protected override async Task ReceiveMessageAsync(Message message, Contact contact, UserContext userContext, CancellationToken cancellationToken) { await _flowService.SendOnboardingFlowAsync(userContext, message, cancellationToken); }