예제 #1
0
        public async Task SelectMainTeamReceiverUnitTest(string text, string teamTag)
        {
            var message = new Message
            {
                From    = UnitTestBuilder.GetUserNode(),
                To      = UnitTestBuilder.GetBotNode(),
                Content = PlainText.Parse(text + teamTag)
            };
            var context = new UserContext
            {
                MainTeam = ""
            };

            bool success = false;

            try
            {
                success = await flowService.SendSelectMainTeamFlowAsync(message, context, CancellationToken.None);

                context = await contextManager.GetUserContextAsync(message.From, CancellationToken.None);
            }
            catch (Exception ex)
            {
                ex.ShouldBeNull();
            }
            finally
            {
                success.ShouldBeTrue();
                context.MainTeam.ShouldBe(teamTag);
            }
        }
예제 #2
0
 protected override async Task ReceiveMessageAsync(Message message, Contact contact, UserContext userContext, CancellationToken cancellationToken)
 {
     await _flowService.SendSelectMainTeamFlowAsync(message, userContext, cancellationToken);
 }